Optimize memory layout for SMaterialLayer

SMaterialLayer going down from 40 to 32 bytes on 64-bit systems according to the new VS memory layout tool (nice toy!)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6596 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2024-02-22 11:19:58 +00:00
parent e3f3f753de
commit d9de5f2306
1 changed files with 5 additions and 3 deletions

View File

@ -52,7 +52,7 @@ namespace video
//! Default constructor
SMaterialLayer() : Texture(0), TextureWrapU(ETC_REPEAT), TextureWrapV(ETC_REPEAT), TextureWrapW(ETC_REPEAT),
BilinearFilter(true), TrilinearFilter(false), AnisotropicFilter(0), LODBias(0),
TextureMatrix(0), TextureMatrixUsed(false)
TextureMatrixUsed(false), TextureMatrix(0)
{
}
@ -243,13 +243,15 @@ namespace video
private:
friend class SMaterial;
irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator;
// TextureMatrix memory stays until destructor even when unused to avoid unnecessary allocation/de-allocations
bool TextureMatrixUsed;
//! Texture Matrix
/** Do not access this element directly as the internal
resource management has to cope with Null pointers etc. */
core::matrix4* TextureMatrix;
bool TextureMatrixUsed; // TextureMatrix memory stays until destructor even when unused to avoid unnecessary allocation/de-allocations
irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator;
};
} // end namespace video