Detect the simplest Tactics Ogre case (US/EU) early

Removes the need for the compat.ini flag for these versions, since we
can just treat the texture exactly as a regular 2D texture.
This commit is contained in:
Henrik Rydgård 2023-08-30 10:27:19 +02:00
parent 86b37dc64a
commit 30a165b1dd
2 changed files with 15 additions and 12 deletions

View File

@ -2777,15 +2777,22 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
int tw = gstate.getTextureWidth(0);
int th = gstate.getTextureHeight(0);
bool pure3D = true;
if (!isFakeMipmapChange) {
for (int i = 0; i < plan.levelsToLoad; i++) {
if (gstate.getTextureWidth(i) != gstate.getTextureWidth(0) || gstate.getTextureHeight(i) != gstate.getTextureHeight(0)) {
pure3D = false;
break;
}
for (int i = 0; i < plan.levelsToLoad; i++) {
if (gstate.getTextureWidth(i) != gstate.getTextureWidth(0) || gstate.getTextureHeight(i) != gstate.getTextureHeight(0)) {
pure3D = false;
break;
}
} else {
}
// Check early for the degenerate case from Tactics Ogre.
if (pure3D && plan.levelsToLoad == 2 && gstate.getTextureAddress(0) == gstate.getTextureAddress(1)) {
// Simply treat it as a regular 2D texture, no fake mipmaps or anything
plan.levelsToLoad = 1;
isFakeMipmapChange = false;
pure3D = false;
} else if (isFakeMipmapChange) {
// We don't want to create a volume texture, if this is a "fake mipmap change".
// In practice due to the compat flag, the only time we end up here is in JP Tactics Ogre.
pure3D = false;
}

View File

@ -269,11 +269,7 @@ ULJM06365 = true
ULJM05753 = true
NPJH50348 = true
ULJM06009 = true
# Tactics Ogre (US, EU). See #17491 / #17980
# Required for texture replacement to work correctly, though unlike JP, only one layer is actually used (two duplicates, really)
ULUS10565 = true
ULES01500 = true
# We handle the US/EU versions by detecting its weird use of two identical mipmaps and treating it as a normal 2D texture (#17491 / #17980)
[RequireBufferedRendering]
# Warn the user that the game will not work and have issue, if buffered rendering is not enabled.