Fixed mipoffset

This commit is contained in:
Xiao Qi 2022-09-27 14:12:05 +08:00
parent 60540b1adc
commit 5d022b7123
1 changed files with 2 additions and 2 deletions

View File

@ -70,12 +70,12 @@ namespace SHADE
size_t totalBytes{ 0 }; size_t totalBytes{ 0 };
std::vector<uint32_t> mipOff; std::vector<uint32_t> mipOff(file.GetMipCount());
for (auto i{0}; i < file.GetMipCount(); ++i) for (auto i{0}; i < file.GetMipCount(); ++i)
{ {
totalBytes += file.GetImageData(i, 0)->m_memSlicePitch;
mipOff.push_back(totalBytes); mipOff.push_back(totalBytes);
totalBytes += file.GetImageData(i, 0)->m_memSlicePitch;
} }
SHTexture::PixelChannel* pixel = new SHTexture::PixelChannel[totalBytes]; SHTexture::PixelChannel* pixel = new SHTexture::PixelChannel[totalBytes];