diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-03-14 09:35:40 -0400 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-03-14 09:35:40 -0400 |
| commit | 95e7c247df206e5268eb16e7c9ce0025a0f56d76 (patch) | |
| tree | 2d2535c78f84cfc211affb9618df6b15e8dddca1 /Source/Core/VideoCommon/HiresTextures.cpp | |
| parent | f0e25b84777fa1090ff53d0844a982bb44a83435 (diff) | |
| parent | 1544e4049d538f5b6f4851f711ed69ac6708e35b (diff) | |
Merge pull request #3700 from degasus/custom_textures
CustomTextures: Fix loading of the last mipmaps.
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/HiresTextures.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index b03b489305..5d177a0257 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -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 { |
