Replacement: Fix mip level loading. Fix bug if LoadIni gets rerun for some reason.

This commit is contained in:
Henrik Rydgård committed 2023-03-10 23:58:15 +01:00
1 parent 3dc2463b55
commit 8e3428438e
2 files changed
+9 -1

No files matched your search

+2 -1
View File
@@ -2829,8 +2829,9 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
if (plan.replaceValid) {
// We're replacing, so we won't scale.
plan.scaleFactor = 1;
// We're ignoring how many levels were specified - instead we just load all available from the replacer.
plan.levelsToLoad = plan.replaced->NumLevels();
plan.levelsToCreate = std::min(plan.levelsToLoad, plan.levelsToCreate);
plan.levelsToCreate = plan.levelsToLoad; // Or more, if we wanted to generate.
plan.badMipSizes = false;
// But, we still need to create the texture at a larger size.
plan.replaced->GetSize(0, &plan.createW, &plan.createH);