CustomTextures: Fix loading of the last mipmaps.
Non-square textures still have mipmaps down to 1x1.
This commit is contained in:
parent
c513a3bda5
commit
1544e4049d
|
@ -417,13 +417,17 @@ std::unique_ptr<HiresTexture> HiresTexture::Load(const std::string& base_filenam
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the size of the next mipmap
|
|
||||||
width >>= 1;
|
|
||||||
height >>= 1;
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = std::unique_ptr<HiresTexture>(new HiresTexture);
|
ret = std::unique_ptr<HiresTexture>(new HiresTexture);
|
||||||
ret->m_levels.push_back(std::move(l));
|
ret->m_levels.push_back(std::move(l));
|
||||||
|
|
||||||
|
// no more mipmaps available
|
||||||
|
if (width == 1 && height == 1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// calculate the size of the next mipmap
|
||||||
|
width = std::max(1u, width >> 1);
|
||||||
|
height = std::max(1u, height >> 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue