forked from Mirrorlandia_minetest/irrlicht
Rename E_MATERIAL_FLAG -> E_MATERIAL_PROP
The enum values don't reference material flags, but material properties.
This commit is contained in:
parent
5ececc7d29
commit
c0ef1092c0
@ -2,86 +2,86 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __E_MATERIAL_FLAGS_H_INCLUDED__
|
||||
#define __E_MATERIAL_FLAGS_H_INCLUDED__
|
||||
#ifndef __E_MATERIAL_PROPS_H_INCLUDED__
|
||||
#define __E_MATERIAL_PROPS_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
//! Material flags
|
||||
enum E_MATERIAL_FLAG
|
||||
//! Material properties
|
||||
enum E_MATERIAL_PROP
|
||||
{
|
||||
//! Corresponds to SMaterial::Wireframe.
|
||||
EMF_WIREFRAME = 0x1,
|
||||
EMP_WIREFRAME = 0x1,
|
||||
|
||||
//! Corresponds to SMaterial::PointCloud.
|
||||
EMF_POINTCLOUD = 0x2,
|
||||
EMP_POINTCLOUD = 0x2,
|
||||
|
||||
//! Corresponds to SMaterial::GouraudShading.
|
||||
EMF_GOURAUD_SHADING = 0x4,
|
||||
EMP_GOURAUD_SHADING = 0x4,
|
||||
|
||||
//! Corresponds to SMaterial::Lighting.
|
||||
EMF_LIGHTING = 0x8,
|
||||
EMP_LIGHTING = 0x8,
|
||||
|
||||
//! Corresponds to SMaterial::ZBuffer.
|
||||
EMF_ZBUFFER = 0x10,
|
||||
EMP_ZBUFFER = 0x10,
|
||||
|
||||
//! Corresponds to SMaterial::ZWriteEnable.
|
||||
EMF_ZWRITE_ENABLE = 0x20,
|
||||
EMP_ZWRITE_ENABLE = 0x20,
|
||||
|
||||
//! Corresponds to SMaterial::BackfaceCulling.
|
||||
EMF_BACK_FACE_CULLING = 0x40,
|
||||
EMP_BACK_FACE_CULLING = 0x40,
|
||||
|
||||
//! Corresponds to SMaterial::FrontfaceCulling.
|
||||
EMF_FRONT_FACE_CULLING = 0x80,
|
||||
EMP_FRONT_FACE_CULLING = 0x80,
|
||||
|
||||
//! Corresponds to SMaterialLayer::MinFilter.
|
||||
EMF_MIN_FILTER = 0x100,
|
||||
EMP_MIN_FILTER = 0x100,
|
||||
|
||||
//! Corresponds to SMaterialLayer::MagFilter.
|
||||
EMF_MAG_FILTER = 0x200,
|
||||
EMP_MAG_FILTER = 0x200,
|
||||
|
||||
//! Corresponds to SMaterialLayer::AnisotropicFilter.
|
||||
EMF_ANISOTROPIC_FILTER = 0x400,
|
||||
EMP_ANISOTROPIC_FILTER = 0x400,
|
||||
|
||||
//! Corresponds to SMaterial::FogEnable.
|
||||
EMF_FOG_ENABLE = 0x800,
|
||||
EMP_FOG_ENABLE = 0x800,
|
||||
|
||||
//! Corresponds to SMaterial::NormalizeNormals.
|
||||
EMF_NORMALIZE_NORMALS = 0x1000,
|
||||
EMP_NORMALIZE_NORMALS = 0x1000,
|
||||
|
||||
//! Corresponds to SMaterialLayer::TextureWrapU, TextureWrapV and
|
||||
//! TextureWrapW.
|
||||
EMF_TEXTURE_WRAP = 0x2000,
|
||||
EMP_TEXTURE_WRAP = 0x2000,
|
||||
|
||||
//! Corresponds to SMaterial::AntiAliasing.
|
||||
EMF_ANTI_ALIASING = 0x4000,
|
||||
EMP_ANTI_ALIASING = 0x4000,
|
||||
|
||||
//! Corresponds to SMaterial::ColorMask.
|
||||
EMF_COLOR_MASK = 0x8000,
|
||||
EMP_COLOR_MASK = 0x8000,
|
||||
|
||||
//! Corresponds to SMaterial::ColorMaterial.
|
||||
EMF_COLOR_MATERIAL = 0x10000,
|
||||
EMP_COLOR_MATERIAL = 0x10000,
|
||||
|
||||
//! Corresponds to SMaterial::UseMipMaps.
|
||||
EMF_USE_MIP_MAPS = 0x20000,
|
||||
EMP_USE_MIP_MAPS = 0x20000,
|
||||
|
||||
//! Corresponds to SMaterial::BlendOperation.
|
||||
EMF_BLEND_OPERATION = 0x40000,
|
||||
EMP_BLEND_OPERATION = 0x40000,
|
||||
|
||||
//! Corresponds to SMaterial::PolygonOffsetFactor, PolygonOffsetDirection,
|
||||
//! PolygonOffsetDepthBias and PolygonOffsetSlopeScale.
|
||||
EMF_POLYGON_OFFSET = 0x80000,
|
||||
EMP_POLYGON_OFFSET = 0x80000,
|
||||
|
||||
//! Corresponds to SMaterial::BlendFactor.
|
||||
EMF_BLEND_FACTOR = 0x100000,
|
||||
EMP_BLEND_FACTOR = 0x100000,
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __E_MATERIAL_FLAGS_H_INCLUDED__
|
||||
#endif // __E_MATERIAL_PROPS_H_INCLUDED__
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "irrArray.h"
|
||||
#include "irrMath.h"
|
||||
#include "EMaterialTypes.h"
|
||||
#include "EMaterialFlags.h"
|
||||
#include "EMaterialProps.h"
|
||||
#include "SMaterialLayer.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API
|
||||
|
||||
|
@ -18,16 +18,16 @@ namespace video
|
||||
SMaterial Material;
|
||||
|
||||
//! Which values are overridden
|
||||
/** OR'ed values from E_MATERIAL_FLAGS. */
|
||||
u32 EnableFlags;
|
||||
/** OR'ed values from E_MATERIAL_PROPS. */
|
||||
u32 EnableProps;
|
||||
|
||||
//! For those flags in EnableFlags which affect layers, set which of the layers are affected
|
||||
bool EnableLayerFlags[MATERIAL_MAX_TEXTURES];
|
||||
//! For those properties in EnableProps which affect layers, set which of the layers are affected
|
||||
bool EnableLayerProps[MATERIAL_MAX_TEXTURES];
|
||||
|
||||
//! Which textures are overridden
|
||||
bool EnableTextures[MATERIAL_MAX_TEXTURES];
|
||||
|
||||
//! Overwrite complete layers (settings of EnableLayerFlags and EnableTextures don't matter then for layer data)
|
||||
//! Overwrite complete layers (settings of EnableLayerProps and EnableTextures don't matter then for layer data)
|
||||
bool EnableLayers[MATERIAL_MAX_TEXTURES];
|
||||
|
||||
//! Set in which render passes the material override is active.
|
||||
@ -59,19 +59,19 @@ namespace video
|
||||
core::array<SMaterialTypeReplacement> MaterialTypes;
|
||||
|
||||
//! Default constructor
|
||||
SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false)
|
||||
SOverrideMaterial() : EnableProps(0), EnablePasses(0), Enabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
//! disable overrides and reset all flags
|
||||
//! disable overrides and reset all properties
|
||||
void reset()
|
||||
{
|
||||
EnableFlags = 0;
|
||||
EnableProps = 0;
|
||||
EnablePasses = 0;
|
||||
Enabled = false;
|
||||
for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i)
|
||||
{
|
||||
EnableLayerFlags[i] = true; // doesn't do anything unless EnableFlags is set, just saying by default all texture layers are affected by flags
|
||||
EnableLayerProps[i] = true; // doesn't do anything unless EnableProps is set, just saying by default all texture layers are affected by properties
|
||||
EnableTextures[i] = false;
|
||||
EnableLayers[i] = false;
|
||||
}
|
||||
@ -92,51 +92,51 @@ namespace video
|
||||
for (u32 f=0; f<32; ++f)
|
||||
{
|
||||
const u32 num=(1<<f);
|
||||
if (EnableFlags & num)
|
||||
if (EnableProps & num)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break;
|
||||
case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
|
||||
case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
|
||||
case EMF_LIGHTING: material.Lighting = Material.Lighting; break;
|
||||
case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
|
||||
case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
|
||||
case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
|
||||
case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
|
||||
case EMF_MIN_FILTER:
|
||||
case EMP_WIREFRAME: material.Wireframe = Material.Wireframe; break;
|
||||
case EMP_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
|
||||
case EMP_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
|
||||
case EMP_LIGHTING: material.Lighting = Material.Lighting; break;
|
||||
case EMP_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
|
||||
case EMP_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
|
||||
case EMP_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
|
||||
case EMP_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
|
||||
case EMP_MIN_FILTER:
|
||||
for ( u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
||||
{
|
||||
if ( EnableLayerFlags[i] )
|
||||
if ( EnableLayerProps[i] )
|
||||
{
|
||||
material.TextureLayer[i].MinFilter = Material.TextureLayer[i].MinFilter;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EMF_MAG_FILTER:
|
||||
case EMP_MAG_FILTER:
|
||||
for ( u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
||||
{
|
||||
if ( EnableLayerFlags[i] )
|
||||
if ( EnableLayerProps[i] )
|
||||
{
|
||||
material.TextureLayer[i].MagFilter = Material.TextureLayer[i].MagFilter;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EMF_ANISOTROPIC_FILTER:
|
||||
case EMP_ANISOTROPIC_FILTER:
|
||||
for ( u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
||||
{
|
||||
if ( EnableLayerFlags[i] )
|
||||
if ( EnableLayerProps[i] )
|
||||
{
|
||||
material.TextureLayer[i].AnisotropicFilter = Material.TextureLayer[i].AnisotropicFilter;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
|
||||
case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
|
||||
case EMF_TEXTURE_WRAP:
|
||||
case EMP_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
|
||||
case EMP_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
|
||||
case EMP_TEXTURE_WRAP:
|
||||
for ( u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
||||
{
|
||||
if ( EnableLayerFlags[i] )
|
||||
if ( EnableLayerProps[i] )
|
||||
{
|
||||
material.TextureLayer[i].TextureWrapU = Material.TextureLayer[i].TextureWrapU;
|
||||
material.TextureLayer[i].TextureWrapV = Material.TextureLayer[i].TextureWrapV;
|
||||
@ -144,13 +144,13 @@ namespace video
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
|
||||
case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
|
||||
case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
|
||||
case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
|
||||
case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
|
||||
case EMF_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
|
||||
case EMF_POLYGON_OFFSET:
|
||||
case EMP_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
|
||||
case EMP_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
|
||||
case EMP_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
|
||||
case EMP_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
|
||||
case EMP_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
|
||||
case EMP_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
|
||||
case EMP_POLYGON_OFFSET:
|
||||
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
|
||||
material.PolygonOffsetFactor = Material.PolygonOffsetFactor;
|
||||
material.PolygonOffsetDepthBias = Material.PolygonOffsetDepthBias;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "EGUIAlignment.h"
|
||||
#include "EGUIElementTypes.h"
|
||||
#include "EHardwareBufferFlags.h"
|
||||
#include "EMaterialFlags.h"
|
||||
#include "EMaterialProps.h"
|
||||
#include "EMaterialTypes.h"
|
||||
#include "EMeshWriterEnums.h"
|
||||
#include "ESceneNodeTypes.h"
|
||||
|
Loading…
Reference in New Issue
Block a user