From 4f0226da62fba81d2e9ae531889bffaf7ab4dca2 Mon Sep 17 00:00:00 2001 From: stupak Date: Sat, 1 Feb 2025 10:35:37 +0100 Subject: [PATCH] Fixed Texture::convertToImage mipmap cycle. If the method is called with includeMipMaps = FALSE or if the Texture has only one/primary mipmap in that case numMips = 0. Therefore the code just creates an empty Ogre::Image without filling its content. --- OgreMain/src/OgreTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OgreMain/src/OgreTexture.cpp b/OgreMain/src/OgreTexture.cpp index 7468105aded..796fb3cfc92 100644 --- a/OgreMain/src/OgreTexture.cpp +++ b/OgreMain/src/OgreTexture.cpp @@ -394,7 +394,7 @@ namespace Ogre { for (uint32 face = 0; face < getNumFaces(); ++face) { - for (uint32 mip = 0; mip < numMips; ++mip) + for (uint32 mip = 0; mip <= numMips; ++mip) { getBuffer(face, mip)->blitToMemory(destImage.getPixelBox(face, mip)); }