2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-06-06 16:37:42 +00:00

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
This commit is contained in:
Jan 2020-02-22 01:53:24 +01:00
parent 5ef1e585c6
commit f0c50ce943

View File

@ -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<int>(_countof(iwi27::IwiHeader::fileSizeForPicmip))