mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Fix Cubemap mipmap sizes
This commit is contained in:
@ -220,7 +220,7 @@ public:
|
||||
for (auto mipLevel = 0; mipLevel < mipCount; mipLevel++)
|
||||
{
|
||||
const auto* buffer = m_texture->GetBufferForMipLevel(mipLevel);
|
||||
const auto mipLevelSize = m_texture->GetSizeOfMipLevel(mipLevel);
|
||||
const auto mipLevelSize = m_texture->GetSizeOfMipLevel(mipLevel) * m_texture->GetFaceCount();
|
||||
m_file->Write(buffer, 1, mipLevelSize);
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void IwiWriter27::DumpImage(FileAPI::IFile* file, Texture* texture)
|
||||
const int textureMipCount = texture->HasMipMaps() ? texture->GetMipMapCount() : 1;
|
||||
for (int currentMipLevel = textureMipCount - 1; currentMipLevel >= 0; currentMipLevel--)
|
||||
{
|
||||
const size_t mipLevelSize = texture->GetSizeOfMipLevel(currentMipLevel);
|
||||
const size_t mipLevelSize = texture->GetSizeOfMipLevel(currentMipLevel) * texture->GetFaceCount();
|
||||
currentFileSize += mipLevelSize;
|
||||
|
||||
if(currentMipLevel < static_cast<int>(_countof(iwi27::IwiHeader::fileSizeForPicmip)))
|
||||
@ -132,7 +132,7 @@ void IwiWriter27::DumpImage(FileAPI::IFile* file, Texture* texture)
|
||||
|
||||
for (int currentMipLevel = textureMipCount - 1; currentMipLevel >= 0; currentMipLevel--)
|
||||
{
|
||||
const size_t mipLevelSize = texture->GetSizeOfMipLevel(currentMipLevel);
|
||||
const size_t mipLevelSize = texture->GetSizeOfMipLevel(currentMipLevel) * texture->GetFaceCount();
|
||||
file->Write(texture->GetBufferForMipLevel(currentMipLevel), 1, mipLevelSize);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user