mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-28 22:21:19 +00:00
- fixed: wall sprites do not need NPOT emulation.
This commit is contained in:
parent
d078b511b8
commit
be20b6a839
2 changed files with 12 additions and 12 deletions
|
@ -156,19 +156,18 @@ void HWWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
|
||||||
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
||||||
{
|
{
|
||||||
SetLightAndFog(state, fade, palette, shade, visibility, alpha);
|
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);
|
||||||
|
|
||||||
int h = (int)texture->GetDisplayHeight();
|
if (sprite == nullptr)
|
||||||
int h2 = 1 << sizeToBits(h);
|
|
||||||
if (h2 < h) h2 *= 2;
|
|
||||||
if (h != h2)
|
|
||||||
{
|
{
|
||||||
float xOffset = 1.f / texture->GetDisplayWidth();
|
int h = (int)texture->GetDisplayHeight();
|
||||||
state.SetNpotEmulation(float(h2) / h, xOffset);
|
int h2 = 1 << sizeToBits(h);
|
||||||
}
|
if (h2 < h) h2 *= 2;
|
||||||
else
|
if (h != h2)
|
||||||
{
|
{
|
||||||
state.SetNpotEmulation(0.f, 0.f);
|
float xOffset = 1.f / texture->GetDisplayWidth();
|
||||||
|
state.SetNpotEmulation(float(h2) / h, xOffset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderWall(di, state, rflags);
|
RenderWall(di, state, rflags);
|
||||||
|
@ -1047,7 +1046,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
|
||||||
backsector = sector;
|
backsector = sector;
|
||||||
texture = tex;
|
texture = tex;
|
||||||
|
|
||||||
flags = 0;
|
flags = HWF_CLAMPX|HWF_CLAMPY;
|
||||||
dynlightindex = -1;
|
dynlightindex = -1;
|
||||||
shade = clamp(spr->shade, 0, numshades - 1);
|
shade = clamp(spr->shade, 0, numshades - 1);
|
||||||
palette = spr->pal;
|
palette = spr->pal;
|
||||||
|
|
|
@ -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.
|
renderState.Apply(*screen->RenderState(), lastState); // apply any pending change before returning.
|
||||||
rendercommands.Clear();
|
rendercommands.Clear();
|
||||||
hw_int_useindexedcolortextures = false;
|
hw_int_useindexedcolortextures = false;
|
||||||
|
|
Loading…
Reference in a new issue