Merge pull request #3700 from degasus/custom_textures

CustomTextures: Fix loading of the last mipmaps.
This commit is contained in:
Ryan Houdek 2016-03-14 09:35:40 -04:00
commit 95e7c247df
1 changed files with 8 additions and 4 deletions

View File

@ -417,13 +417,17 @@ std::unique_ptr<HiresTexture> HiresTexture::Load(const std::string& base_filenam
break;
}
// calculate the size of the next mipmap
width >>= 1;
height >>= 1;
if (!ret)
ret = std::unique_ptr<HiresTexture>(new HiresTexture);
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
{