1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Remove needReplaceTex1byTex0()

This commit is contained in:
s2s 2021-08-22 23:21:34 +02:00 committed by Sergey Lipskiy
parent 134aa31e61
commit dd64b42081
4 changed files with 5 additions and 23 deletions

View File

@ -1084,14 +1084,12 @@ public:
uBilinearOffset.set(bilinearOffset, bilinearOffset, _force);
TextureCache & cache = textureCache();
const bool replaceTex1ByTex0 = needReplaceTex1ByTex0();
for (u32 t = 0; t < 2; ++t) {
if (!m_useTile[t])
continue;
const u32 tile = replaceTex1ByTex0 ? 0 : t;
const gDPTile * pTile = gSP.textureTile[tile];
CachedTexture * pTexture = cache.current[tile];
const gDPTile * pTile = gSP.textureTile[t];
CachedTexture * pTexture = cache.current[t];
if (pTile == nullptr || pTexture == nullptr)
continue;

View File

@ -1562,14 +1562,6 @@ void TextureCache::update(u32 _t)
return;
}
if (_t == 1 && needReplaceTex1ByTex0()) {
current[1] = current[0];
if (current[1] != nullptr) {
activateTexture(1, current[1]);
return;
}
}
if (gSP.texture.tile == 7 &&
_t == 0 &&
gSP.textureTile[0] == gDP.loadTile &&
@ -1691,9 +1683,4 @@ void getTextureShiftScale(u32 t, const TextureCache & cache, f32 & shiftScaleS,
shiftScaleT = (f32)(1 << (16 - gSP.textureTile[t]->shiftt));
else if (gSP.textureTile[t]->shiftt > 0)
shiftScaleT /= (f32)(1 << gSP.textureTile[t]->shiftt);
}
bool needReplaceTex1ByTex0()
{
return gSP.texture.level == 0 && gDP.otherMode.textureLOD == G_TL_LOD && gDP.otherMode.textureDetail == G_TD_CLAMP;
}
}

View File

@ -112,9 +112,6 @@ private:
void getTextureShiftScale(u32 tile, const TextureCache & cache, f32 & shiftScaleS, f32 & shiftScaleT);
// Check for situation when Tex0 is used instead of Tex1
bool needReplaceTex1ByTex0();
inline TextureCache & textureCache()
{
return TextureCache::get();

View File

@ -858,7 +858,7 @@ void gDPTextureRectangle(f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, s16 s, s1
textureTileOrg[0] = gSP.textureTile[0];
textureTileOrg[1] = gSP.textureTile[1];
gSP.textureTile[0] = &gDP.tiles[tile];
gSP.textureTile[1] = needReplaceTex1ByTex0() ? &gDP.tiles[tile] : &gDP.tiles[(tile + 1) & 7];
gSP.textureTile[1] = &gDP.tiles[(tile + 1) & 7];
// HACK ALERT!
if (s == 0x4000 && (gDP.colorImage.width + gSP.textureTile[0]->uls < 512))
@ -973,7 +973,7 @@ void LLETriangle::start(u32 _tile)
m_textureScaleOrg[1] = gSP.texture.scalet;
gSP.texture.tile = _tile;
gSP.textureTile[0] = &gDP.tiles[_tile];
gSP.textureTile[1] = needReplaceTex1ByTex0() ? &gDP.tiles[_tile] : &gDP.tiles[(_tile + 1) & 7];
gSP.textureTile[1] = &gDP.tiles[(_tile + 1) & 7];
gSP.texture.scales = 1.0f;
gSP.texture.scalet = 1.0f;
m_flushed = false;