From f0c50ce94365552a29e560ee19eeabe292e18f3c Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 22 Feb 2020 01:53:24 +0100 Subject: [PATCH] ObjLoading: Fix not being able to load cubemaps due to wrong calculation of mipsize Now includes the face count into the calculation which is 6 for cube maps and 1 for everything else --- src/ObjLoading/Image/IwiLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ObjLoading/Image/IwiLoader.cpp b/src/ObjLoading/Image/IwiLoader.cpp index 3b33f88f..74e5ede2 100644 --- a/src/ObjLoading/Image/IwiLoader.cpp +++ b/src/ObjLoading/Image/IwiLoader.cpp @@ -85,7 +85,7 @@ Texture* IwiLoader::LoadIwi27(FileAPI::IFile* file) for (int currentMipLevel = mipMapCount - 1; currentMipLevel >= 0; currentMipLevel--) { - const size_t sizeOfMipLevel = texture->GetSizeOfMipLevel(currentMipLevel); + const size_t sizeOfMipLevel = texture->GetSizeOfMipLevel(currentMipLevel) * texture->GetFaceCount(); currentFileSize += sizeOfMipLevel; if (currentMipLevel < static_cast(_countof(iwi27::IwiHeader::fileSizeForPicmip))