*/\r
const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_;\r
\r
- //! By default this is identical to MATERIAL_MAX_TEXTURES\r
- /** Users can modify this value if they are certain they don't need all\r
- available textures per material in their application. For example if you\r
- never need more than 2 textures per material you can set this to 2.\r
-\r
- We (mostly) avoid dynamic memory in SMaterial, so the extra memory\r
- will still be allocated. But by lowering MATERIAL_MAX_TEXTURES_USED the\r
- material comparisons and assignments can be faster. Also several other\r
- places in the engine can be faster when reducing this value to the limit\r
- you need.\r
-\r
- NOTE: This should only be changed once and before any call to createDevice.\r
- NOTE: Do not set it below 1 or above the value of _IRR_MATERIAL_MAX_TEXTURES_.\r
- NOTE: Going below 4 is usually not worth it.\r
- */\r
- IRRLICHT_API extern u32 MATERIAL_MAX_TEXTURES_USED;\r
-\r
//! Struct for holding parameters for a material renderer\r
// Note for implementors: Serialization is in CNullDriver\r
class SMaterial\r
SMaterial(const SMaterial& other)\r
{\r
// These pointers are checked during assignment\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
TextureLayer[i].TextureMatrix = 0;\r
*this = other;\r
}\r
FrontfaceCulling = value; break;\r
case EMF_BILINEAR_FILTER:\r
{\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
TextureLayer[i].BilinearFilter = value;\r
}\r
break;\r
case EMF_TRILINEAR_FILTER:\r
{\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
TextureLayer[i].TrilinearFilter = value;\r
}\r
break;\r
case EMF_ANISOTROPIC_FILTER:\r
{\r
if (value)\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
TextureLayer[i].AnisotropicFilter = 0xFF;\r
else\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
TextureLayer[i].AnisotropicFilter = 0;\r
}\r
break;\r
NormalizeNormals = value; break;\r
case EMF_TEXTURE_WRAP:\r
{\r
- for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)\r
+ for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)\r
{\r
TextureLayer[i].TextureWrapU = (E_TEXTURE_CLAMP)value;\r
TextureLayer[i].TextureWrapV = (E_TEXTURE_CLAMP)value;\r
PolygonOffsetSlopeScale != b.PolygonOffsetSlopeScale ||\r
UseMipMaps != b.UseMipMaps\r
;\r
- for (u32 i=0; (i<MATERIAL_MAX_TEXTURES_USED) && !different; ++i)\r
+ for (u32 i=0; (i<MATERIAL_MAX_TEXTURES) && !different; ++i)\r
{\r
different |= (TextureLayer[i] != b.TextureLayer[i]);\r
}\r