From d337f0a316c933a5709b187773a8fbd24572f170 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Tue, 10 May 2016 21:44:03 +0600 Subject: [PATCH] Correct texture select when texture LOD is enabled but combiner does not use LOD. Fixed tunel lamps in Top Gear Rally, #981 --- src/Textures.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Textures.cpp b/src/Textures.cpp index c893992f..1f67d2a4 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -1411,6 +1411,12 @@ void TextureCache::update(u32 _t) return; } + if (gDP.otherMode.textureLOD == G_TL_LOD && gSP.texture.level == 0 && !currentCombiner()->usesLOD() && _t == 1) { + current[1] = current[0]; + activateTexture(_t, current[_t]); + return; + } + if (gSP.texture.tile == 7 && _t == 0 && gSP.textureTile[0] == gDP.loadTile && @@ -1530,6 +1536,9 @@ void getTextureShiftScale(u32 t, const TextureCache & cache, f32 & shiftScaleS, return; } + if (gDP.otherMode.textureLOD == G_TL_LOD && gSP.texture.level == 0 && !currentCombiner()->usesLOD()) + t = 0; + if (gSP.textureTile[t]->shifts > 10) shiftScaleS = (f32)(1 << (16 - gSP.textureTile[t]->shifts)); else if (gSP.textureTile[t]->shifts > 0)