From dd4987c2f14551065a8433653fd9aacb5f8dedd7 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 11 Feb 2020 20:45:57 +0100 Subject: [PATCH] ObjLoading: Fix not setting texture size on loading an image to signalize there's a valid texture object --- src/ObjLoading/Game/T6/ObjLoaderT6.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp index 4aba1394..4699ac13 100644 --- a/src/ObjLoading/Game/T6/ObjLoaderT6.cpp +++ b/src/ObjLoading/Game/T6/ObjLoaderT6.cpp @@ -197,6 +197,11 @@ void ObjLoaderT6::LoadImageFromIwi(T6::GfxImage* image, ISearchPath* searchPath, if(loadedTexture != nullptr) { image->texture.texture = loadedTexture; + image->loadedSize = 0; + + const int textureMipCount = loadedTexture->GetMipMapCount(); + for(int mipLevel = 0; mipLevel < textureMipCount; mipLevel++) + image->loadedSize += loadedTexture->GetSizeOfMipLevel(mipLevel); } else {