- fixed: wall sprites do not need NPOT emulation.

This commit is contained in:
Christoph Oelckers 2021-04-20 16:58:18 +02:00
parent d078b511b8
commit be20b6a839
2 changed files with 12 additions and 12 deletions

View file

@ -156,8 +156,10 @@ void HWWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
{
SetLightAndFog(state, fade, palette, shade, visibility, alpha);
state.SetMaterial(texture, UF_Texture, 0, sprite == nullptr ? (flags & (HWF_CLAMPX | HWF_CLAMPY)) : CLAMP_XY, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
state.SetMaterial(texture, UF_Texture, 0, (flags & (HWF_CLAMPX | HWF_CLAMPY)), TRANSLATION(Translation_Remap + curbasepal, palette), -1);
if (sprite == nullptr)
{
int h = (int)texture->GetDisplayHeight();
int h2 = 1 << sizeToBits(h);
if (h2 < h) h2 *= 2;
@ -166,9 +168,6 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
float xOffset = 1.f / texture->GetDisplayWidth();
state.SetNpotEmulation(float(h2) / h, xOffset);
}
else
{
state.SetNpotEmulation(0.f, 0.f);
}
RenderWall(di, state, rflags);
@ -1047,7 +1046,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
backsector = sector;
texture = tex;
flags = 0;
flags = HWF_CLAMPX|HWF_CLAMPY;
dynlightindex = -1;
shade = clamp(spr->shade, 0, numshades - 1);
palette = spr->pal;

View file

@ -126,6 +126,7 @@ void GLInstance::DoDraw()
}
}
}
state.SetNpotEmulation(0, 0); // make sure we do not leave this in an undefined state.
renderState.Apply(*screen->RenderState(), lastState); // apply any pending change before returning.
rendercommands.Clear();
hw_int_useindexedcolortextures = false;