- replaced TexMan.operator() with two functions.
This was done to make reviewing easier, again because it is virtually impossible to search for the operators in the code. Going through this revealed quite a few places where texture animations were on but shouldn't and even more places that did not check PASLVERS, although they were preparing some paletted rendering.
This commit is contained in:
parent
3dc9eab743
commit
79a0f76801
41 changed files with 115 additions and 116 deletions
|
|
@ -49,7 +49,7 @@ void RenderPolyDecal::Render(PolyRenderThread *thread, DBaseDecal *decal, const
|
|||
if (decal->RenderFlags & RF_INVISIBLE || !viewactive || !decal->PicNum.isValid())
|
||||
return;
|
||||
|
||||
FTexture *ttex = TexMan(decal->PicNum, true);
|
||||
FTexture *ttex = TexMan.GetPalettedTexture(decal->PicNum, true);
|
||||
if (ttex == nullptr || !ttex->isValid())
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static bool isBright(DPSprite *psp)
|
|||
FTextureID lump = sprites[psp->GetSprite()].GetSpriteFrame(psp->GetFrame(), 0, 0., nullptr);
|
||||
if (lump.isValid())
|
||||
{
|
||||
FTexture * tex = TexMan(lump);
|
||||
FTexture * tex = TexMan.GetPalettedTexture(lump, true);
|
||||
if (tex) disablefullbright = tex->isFullbrightDisabled();
|
||||
}
|
||||
return psp->GetState()->GetFullbright() && !disablefullbright;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void RenderPolyPlane::RenderNormal(PolyRenderThread *thread, const PolyTransferH
|
|||
FTextureID picnum = fakeflat.FrontSector->GetTexture(ceiling ? sector_t::ceiling : sector_t::floor);
|
||||
if (picnum != skyflatnum)
|
||||
{
|
||||
FTexture *tex = TexMan(picnum);
|
||||
FTexture *tex = TexMan.GetPalettedTexture(picnum, true);
|
||||
if (!tex || !tex->isValid())
|
||||
return;
|
||||
|
||||
|
|
@ -510,7 +510,7 @@ void Render3DFloorPlane::RenderPlanes(PolyRenderThread *thread, subsector_t *sub
|
|||
void Render3DFloorPlane::Render(PolyRenderThread *thread)
|
||||
{
|
||||
FTextureID picnum = ceiling ? *fakeFloor->bottom.texture : *fakeFloor->top.texture;
|
||||
auto tex = TexMan(picnum);
|
||||
auto tex = TexMan.GetPalettedTexture(picnum, true);
|
||||
if (!tex->isValid())
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
|
|||
|
||||
picnum = sprframe->Texture[0];
|
||||
flip = sprframe->Flip & 1;
|
||||
ttex = TexMan(picnum);
|
||||
ttex = TexMan.GetPalettedTexture(picnum, true);
|
||||
|
||||
if (!ttex->isValid())
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ Mat4f PolySkyDome::GLSkyMath()
|
|||
|
||||
static FSoftwareTexture *GetSWTex(FTextureID texid, bool allownull = true)
|
||||
{
|
||||
auto tex = TexMan(texid, true);
|
||||
auto tex = TexMan.GetPalettedTexture(texid, true);
|
||||
if (tex == nullptr) return nullptr;
|
||||
if (!allownull && !tex->isValid()) return nullptr;
|
||||
return tex->GetSoftwareTexture();
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ FSoftwareTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool
|
|||
|
||||
if (thing->picnum.isValid())
|
||||
{
|
||||
FTexture *ttex = TexMan(thing->picnum);
|
||||
FTexture *ttex = TexMan.GetPalettedTexture(thing->picnum, true);
|
||||
if (!ttex || !ttex->isValid())
|
||||
{
|
||||
return nullptr;
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ bool RenderPolyWall::RenderLine(PolyRenderThread *thread, seg_t *line, sector_t
|
|||
wall.Alpha = wall.Line->alpha;
|
||||
wall.FogBoundary = IsFogBoundary(frontsector, backsector);
|
||||
|
||||
FTexture *midtex = TexMan(line->sidedef->GetTexture(side_t::mid), true);
|
||||
FTexture *midtex = TexMan.GetPalettedTexture(line->sidedef->GetTexture(side_t::mid), true);
|
||||
if ((midtex && midtex->isValid()) || wall.FogBoundary)
|
||||
translucentWallsOutput.push_back(thread->FrameMemory->NewObject<PolyTranslucentWall>(wall));
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ void RenderPolyWall::ClampHeight(TriVertex &v1, TriVertex &v2)
|
|||
|
||||
FSoftwareTexture *RenderPolyWall::GetTexture(const line_t *line, const side_t *side, side_t::ETexpart texpart)
|
||||
{
|
||||
FTexture *tex = TexMan(side->GetTexture(texpart), true);
|
||||
FTexture *tex = TexMan.GetPalettedTexture(side->GetTexture(texpart), true);
|
||||
if (tex == nullptr || !tex->isValid())
|
||||
{
|
||||
// Mapping error. Doom floodfills this with a plane.
|
||||
|
|
@ -537,16 +537,16 @@ FSoftwareTexture *RenderPolyWall::GetTexture(const line_t *line, const side_t *s
|
|||
if (line && line->backsector && line->sidedef[0] == side)
|
||||
{
|
||||
if (texpart == side_t::top)
|
||||
tex = TexMan(line->backsector->GetTexture(sector_t::ceiling), true);
|
||||
tex = TexMan.GetPalettedTexture(line->backsector->GetTexture(sector_t::ceiling), true);
|
||||
else if (texpart == side_t::bottom)
|
||||
tex = TexMan(line->backsector->GetTexture(sector_t::floor), true);
|
||||
tex = TexMan.GetPalettedTexture(line->backsector->GetTexture(sector_t::floor), true);
|
||||
}
|
||||
if (line && line->backsector && line->sidedef[1] == side)
|
||||
{
|
||||
if (texpart == side_t::top)
|
||||
tex = TexMan(line->frontsector->GetTexture(sector_t::ceiling), true);
|
||||
tex = TexMan.GetPalettedTexture(line->frontsector->GetTexture(sector_t::ceiling), true);
|
||||
else if (texpart == side_t::bottom)
|
||||
tex = TexMan(line->frontsector->GetTexture(sector_t::floor), true);
|
||||
tex = TexMan.GetPalettedTexture(line->frontsector->GetTexture(sector_t::floor), true);
|
||||
}
|
||||
|
||||
if (tex == nullptr || !tex->isValid())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue