diff --git a/changes.txt b/changes.txt index e04a147d..c95a869f 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ -------------------------- Changes in 1.9 (not yet released) +- Add SMaterialLayer::hasSetTextureMatrix and SMaterialLayer::resetTextureMatrix - Add IShaderConstantSetCallBack::OnCreate to allow earlier access to IMaterialRendererServices - CIrrDeviceWin32::yield() now uses Sleep(0) instead of Sleep(1). We had Sleep(1) to allow yielding to all processes back in Windows XP time. diff --git a/include/SMaterialLayer.h b/include/SMaterialLayer.h index 51ddf668..48698cd5 100644 --- a/include/SMaterialLayer.h +++ b/include/SMaterialLayer.h @@ -45,7 +45,7 @@ namespace video "texture_clamp_mirror_clamp_to_border", 0}; //! Struct for holding material parameters which exist per texture layer - // Note for implementors: Serialization is in CNullDriver + // Note for implementers: Serialization is in CNullDriver class SMaterialLayer { public: @@ -153,6 +153,25 @@ namespace video *TextureMatrix = mat; } + //! Check if we have set a custom texture matrix + //! Note that otherwise we get an IdentityMatrix as default + inline bool hasSetTextureMatrix() const + { + return TextureMatrix != 0; + } + + //! Reset texture matrix to identity matrix + //! Releases memory, which is expensive, but ver rarely useful for optimizations + void resetTextureMatrix() + { + if ( TextureMatrix ) + { + MatrixAllocator.destruct(TextureMatrix); + MatrixAllocator.deallocate(TextureMatrix); + TextureMatrix = 0; + } + } + //! Inequality operator /** \param b Layer to compare to. \return True if layers are different, else false. */ diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 71642710..a8373c23 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ Tests finished. 72 tests of 72 passed. Compiled as DEBUG -Test suite pass at GMT Fri Apr 21 14:37:22 2023 +Test suite pass at GMT Fri Apr 28 17:44:32 2023