diff --git a/include/ITexture.h b/include/ITexture.h index 9fe7a7c6..ac285720 100644 --- a/include/ITexture.h +++ b/include/ITexture.h @@ -211,8 +211,7 @@ public: only mode or read from in write only mode. Support for this feature depends on the driver, so don't rely on the texture being write-protected when locking with read-only, etc. - \param mipmapLevel NOTE: Currently broken, sorry, we try if we can repair it for 1.9 release. - Number of the mipmapLevel to lock. 0 is main texture. + \param mipmapLevel Number of the mipmapLevel to lock. 0 is main texture. Non-existing levels will silently fail and return 0. \param layer It determines which cubemap face or texture array layer should be locked. \param lockFlags See E_TEXTURE_LOCK_FLAGS documentation. diff --git a/source/Irrlicht/CSoftwareTexture.cpp b/source/Irrlicht/CSoftwareTexture.cpp index 4d36a2a6..11a2259b 100644 --- a/source/Irrlicht/CSoftwareTexture.cpp +++ b/source/Irrlicht/CSoftwareTexture.cpp @@ -78,7 +78,10 @@ CSoftwareTexture::~CSoftwareTexture() //! lock function void* CSoftwareTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel, u32 layer, E_TEXTURE_LOCK_FLAGS lockFlags) { - return Image->getData(); + if ( mipmapLevel == 0 ) + return Image->getData(); + else + return Image->getMipMapsData(mipmapLevel); } diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 683dc845..663ce94e 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 Sep 22 15:57:32 2023 +Test suite pass at GMT Tue Oct 17 17:50:36 2023