Skip to content

Commit 8128c82

Browse files
vtfpp: fix dumb error breaking mip calculations
1 parent 46707cd commit 8128c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vtfpp/VTF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void VTF::computeMips(ImageConversion::ResizeFilter filter) {
11661166
#endif
11671167
for (int i = 1; i < this->mipCount; i++) {
11681168
const auto [mipWidth, mipHeight, mipDepth] = ImageDimensions::getMipDims(i, compressed, this->width, this->height, this->depth);
1169-
const auto [mipWidthM1, mipHeightM1] = ImageDimensions::getMipDims(i, compressed, this->width, this->height);
1169+
const auto [mipWidthM1, mipHeightM1] = ImageDimensions::getMipDims(i - 1, compressed, this->width, this->height);
11701170
for (int l = 0; l < mipDepth; l++) {
11711171
auto mip = ImageConversion::resizeImageData(this->getImageDataRaw(i - 1, j, k, l), this->format, mipWidthM1, mipWidth, mipHeightM1, mipHeight, this->isSRGB(), filter);
11721172
if (uint32_t offset, length; ImageFormatDetails::getDataPosition(offset, length, this->format, i, this->mipCount, j, this->frameCount, k, faceCount, this->width, this->height, l, this->depth) && mip.size() == length) {

0 commit comments

Comments
 (0)