Skip to content

Commit

Permalink
- replaced TexMan.operator() with two functions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
coelckers committed Dec 7, 2018
1 parent 3dc9eab commit 79a0f76
Show file tree
Hide file tree
Showing 41 changed files with 115 additions and 116 deletions.
8 changes: 4 additions & 4 deletions src/am_map.cpp
Expand Up @@ -2234,7 +2234,7 @@ void AM_drawSubsectors()
}
else indices.clear();

screen->FillSimplePoly(TexMan(maptex),
screen->FillSimplePoly(TexMan.GetTexture(maptex, true),
&points[0], points.Size(),
originx, originy,
scale / scalex,
Expand Down Expand Up @@ -3019,7 +3019,7 @@ void AM_drawThings ()
rotation = int((angle.Normalized360() * (16. / 360.)).Degrees);

const FTextureID textureID = frame->Texture[show > 2 ? rotation : 0];
texture = TexMan(textureID);
texture = TexMan.GetTexture(textureID, true);
}

if (texture == NULL) goto drawTriangle; // fall back to standard display if no sprite can be found.
Expand Down Expand Up @@ -3150,7 +3150,7 @@ void AM_drawMarks ()
{
if (markpoints[i].x != -1)
{
DrawMarker (TexMan(marknums[i]), markpoints[i].x, markpoints[i].y, -3, 0,
DrawMarker (TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0,
1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]);
}
}
Expand Down Expand Up @@ -3183,7 +3183,7 @@ void AM_drawAuthorMarkers ()

if (mark->picnum.isValid())
{
tex = TexMan(mark->picnum);
tex = TexMan.GetTexture(mark->picnum, true);
if (tex->GetRotations() != 0xFFFF)
{
spriteframe_t *sprframe = &SpriteFrames[tex->GetRotations()];
Expand Down
2 changes: 1 addition & 1 deletion src/d_main.cpp
Expand Up @@ -1052,7 +1052,7 @@ void D_PageDrawer (void)
screen->Clear(0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
if (Page.Exists())
{
screen->DrawTexture (TexMan(Page), 0, 0,
screen->DrawTexture (TexMan.GetTexture(Page, true), 0, 0,
DTA_Fullscreen, true,
DTA_Masked, false,
DTA_BilinearFilter, true,
Expand Down
26 changes: 13 additions & 13 deletions src/g_statusbar/sbarinfo_commands.cpp
Expand Up @@ -241,7 +241,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
applyscale = false;
}
if(type == PLAYERICON)
texture = TexMan(statusBar->CPlayer->mo->ScoreIcon);
texture = TexMan.GetTexture(statusBar->CPlayer->mo->ScoreIcon, true);
else if(type == AMMO1)
{
auto ammo = statusBar->ammo1;
Expand Down Expand Up @@ -270,7 +270,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
{
auto item = statusBar->CPlayer->mo->FindInventory(NAME_Sigil);
if (item != NULL)
texture = TexMan(item->TextureIDVar(NAME_Icon));
texture = TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true);
}
else if(type == HEXENARMOR_ARMOR || type == HEXENARMOR_SHIELD || type == HEXENARMOR_HELM || type == HEXENARMOR_AMULET)
{
Expand All @@ -292,9 +292,9 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
}
}
else if(type == INVENTORYICON)
texture = TexMan(sprite);
texture = TexMan.GetTexture(sprite, true);
else if(type == SELECTEDINVENTORYICON && statusBar->CPlayer->mo->InvSel != NULL)
texture = TexMan(statusBar->CPlayer->mo->InvSel->TextureIDVar(NAME_Icon));
texture = TexMan.GetTexture(statusBar->CPlayer->mo->InvSel->TextureIDVar(NAME_Icon), true);
else if(image >= 0)
texture = statusBar->Images[image];

Expand All @@ -316,7 +316,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
spawnScaleY = item->Scale.Y;
}

texture = TexMan(icon);
texture = TexMan.GetTexture(icon, true);
}

enum ImageType
Expand Down Expand Up @@ -2131,7 +2131,7 @@ class CommandDrawInventoryBar : public SBarInfoCommand
statusBar->DrawGraphic(statusBar->Images[statusBar->invBarOffset + imgARTIBOX], rx, ry, block->XOffset(), block->YOffset(), bgalpha, block->FullScreenOffsets());

if(style != STYLE_Strife) //Strife draws the cursor before the icons
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), rx - (style == STYLE_HexenStrict ? 2 : 0), ry - (style == STYLE_HexenStrict ? 1 : 0), block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, item->IntVar(NAME_Amount) <= 0);
statusBar->DrawGraphic(TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true), rx - (style == STYLE_HexenStrict ? 2 : 0), ry - (style == STYLE_HexenStrict ? 1 : 0), block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, item->IntVar(NAME_Amount) <= 0);
if(item == statusBar->CPlayer->mo->InvSel)
{
if(style == STYLE_Heretic)
Expand All @@ -2146,7 +2146,7 @@ class CommandDrawInventoryBar : public SBarInfoCommand
statusBar->DrawGraphic(statusBar->Images[statusBar->invBarOffset + imgSELECTBOX], rx, ry, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
}
if(style == STYLE_Strife)
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), rx, ry, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, item->IntVar(NAME_Amount) <= 0);
statusBar->DrawGraphic(TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true), rx, ry, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets(), false, item->IntVar(NAME_Amount) <= 0);
if(counters != NULL && (alwaysShowCounter || item->IntVar(NAME_Amount) != 1))
{
counters[i]->valueArgument = item->IntVar(NAME_Amount);
Expand Down Expand Up @@ -2369,22 +2369,22 @@ class CommandDrawKeyBar : public SBarInfoCommand
{
if(!vertical)
{
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), x+slotOffset, y+rowOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayHeight()+2 : rowIconSize;
statusBar->DrawGraphic(TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true), x+slotOffset, y+rowOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true)->GetDisplayHeight()+2 : rowIconSize;
}
else
{
statusBar->DrawGraphic(TexMan(item->TextureIDVar(NAME_Icon)), x+rowOffset, y+slotOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayWidth()+2 : rowIconSize;
statusBar->DrawGraphic(TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true), x+rowOffset, y+slotOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true)->GetDisplayWidth()+2 : rowIconSize;
}

// If cmd.special is -1 then the slot size is auto detected
if(iconSize == -1)
{
if(!vertical)
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayWidth() + 2);
slotOffset += (reverse ? -1 : 1) * (TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true)->GetDisplayWidth() + 2);
else
slotOffset += (reverse ? -1 : 1) * (TexMan(item->TextureIDVar(NAME_Icon))->GetDisplayHeight() + 2);
slotOffset += (reverse ? -1 : 1) * (TexMan.GetTexture(item->TextureIDVar(NAME_Icon), true)->GetDisplayHeight() + 2);
}
else
slotOffset += (reverse ? -iconSize : iconSize);
Expand Down
2 changes: 1 addition & 1 deletion src/g_statusbar/shared_sbar.cpp
Expand Up @@ -1323,7 +1323,7 @@ void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int fla
if (!texture.isValid())
return;

FTexture *tex = (flags & DI_DONTANIMATE)? TexMan[texture] : TexMan(texture);
FTexture *tex = TexMan.GetTexture(texture, !(flags & DI_DONTANIMATE));

double texwidth = tex->GetDisplayWidthDouble() * scaleX;
double texheight = tex->GetDisplayHeightDouble() * scaleY;
Expand Down
2 changes: 1 addition & 1 deletion src/gl/shaders/gl_postprocessshader.cpp
Expand Up @@ -216,7 +216,7 @@ void PostProcessShaderInstance::BindTextures()
continue;

FString name = pair->Value;
FTexture *tex = TexMan(TexMan.CheckForTexture(name, ETextureType::Any));
FTexture *tex = TexMan.GetTexture(TexMan.CheckForTexture(name, ETextureType::Any), true);
if (tex && tex->isValid())
{
glUniform1i(location, textureUnit);
Expand Down
2 changes: 1 addition & 1 deletion src/hwrenderer/scene/hw_bsp.cpp
Expand Up @@ -277,7 +277,7 @@ void HWDrawInfo::AddLine (seg_t *seg, bool portalclip)
{
if (!seg->linedef->isVisualPortal())
{
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::mid), true);
if (!tex || !tex->isValid())
{
// nothing to do here!
Expand Down
8 changes: 4 additions & 4 deletions src/hwrenderer/scene/hw_fakeflat.cpp
Expand Up @@ -117,7 +117,7 @@ bool hw_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
// now check for closed sectors!
if (bs_ceilingheight1 <= fs_floorheight1 && bs_ceilingheight2 <= fs_floorheight2)
{
FTexture * tex = TexMan(sidedef->GetTexture(side_t::top));
FTexture * tex = TexMan.GetTexture(sidedef->GetTexture(side_t::top), true);
if (!tex || !tex->isValid()) return false;
if (backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false;
Expand All @@ -126,7 +126,7 @@ bool hw_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto

if (fs_ceilingheight1 <= bs_floorheight1 && fs_ceilingheight2 <= bs_floorheight2)
{
FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom));
FTexture * tex = TexMan.GetTexture(sidedef->GetTexture(side_t::bottom), true);
if (!tex || !tex->isValid()) return false;

// properly render skies (consider door "open" if both floors are sky):
Expand All @@ -140,12 +140,12 @@ bool hw_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
// preserve a kind of transparent door/lift special effect:
if (bs_ceilingheight1 < fs_ceilingheight1 || bs_ceilingheight2 < fs_ceilingheight2)
{
FTexture * tex = TexMan(sidedef->GetTexture(side_t::top));
FTexture * tex = TexMan.GetTexture(sidedef->GetTexture(side_t::top), true);
if (!tex || !tex->isValid()) return false;
}
if (bs_floorheight1 > fs_floorheight1 || bs_floorheight2 > fs_floorheight2)
{
FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom));
FTexture * tex = TexMan.GetTexture(sidedef->GetTexture(side_t::bottom), true);
if (!tex || !tex->isValid()) return false;
}
if (backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
Expand Down
8 changes: 4 additions & 4 deletions src/hwrenderer/scene/hw_sky.cpp
Expand Up @@ -243,13 +243,13 @@ void GLWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vert
{
if (bs->GetPlaneTexZ(sector_t::floor)==fs->GetPlaneTexZ(sector_t::floor)+1.)
{
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::bottom), true);
if (!tex || !tex->isValid()) return;

// very, very, very ugly special case (See Icarus MAP14)
// It is VERY important that this is only done for a floor height difference of 1
// or it will cause glitches elsewhere.
tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::mid), true);
if (tex != NULL && !(seg->linedef->flags & ML_DONTPEGTOP) &&
seg->sidedef->GetTextureYOffset(side_t::mid) > 0)
{
Expand All @@ -265,7 +265,7 @@ void GLWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vert

ztop[0]=ztop[1]=32768.0f;

FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::top), true);
if (bs->GetTexture(sector_t::ceiling) != skyflatnum)

{
Expand Down Expand Up @@ -325,7 +325,7 @@ void GLWall::SkyBottom(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,v
if (fs->GetTexture(sector_t::floor)==skyflatnum)
{
if (bs->special == GLSector_NoSkyDraw) return;
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::bottom), true);

// For lower skies the normal logic only applies to walls with no lower texture.
if (!tex->isValid())
Expand Down
2 changes: 1 addition & 1 deletion src/hwrenderer/scene/hw_sprites.cpp
Expand Up @@ -789,7 +789,7 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
if (isPicnumOverride)
{
// Animate picnum overrides.
auto tex = TexMan(thing->picnum);
auto tex = TexMan.GetTexture(thing->picnum, true);
if (tex == nullptr) return;
patch = tex->GetID();
mirror = false;
Expand Down
6 changes: 3 additions & 3 deletions src/hwrenderer/scene/hw_walls.cpp
Expand Up @@ -1222,7 +1222,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
// Set up the top
//
//
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::top), true);
if (!tex || !tex->isValid())
{
if (front->GetTexture(sector_t::ceiling) == skyflatnum &&
Expand Down Expand Up @@ -1258,7 +1258,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
// Set up the bottom
//
//
tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::bottom), true);
if (!tex || !tex->isValid())
{
// texture is missing - use the lower plane
Expand Down Expand Up @@ -2057,7 +2057,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
sector_t *backsec = isportal? seg->linedef->getPortalDestination()->frontsector : backsector;

bool drawfogboundary = !di->isFullbrightScene() && hw_CheckFog(frontsector, backsec);
FTexture *tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
FTexture *tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::mid), true);
if (tex != NULL)
{
if (i_compatflags & COMPATF_MASKEDMIDTEX)
Expand Down
2 changes: 1 addition & 1 deletion src/hwrenderer/scene/hw_weapon.cpp
Expand Up @@ -131,7 +131,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.GetTexture(lump, true);
if (tex) disablefullbright = tex->isFullbrightDisabled();
}
return psp->GetState()->GetFullbright() && !disablefullbright;
Expand Down
2 changes: 1 addition & 1 deletion src/hwrenderer/textures/hw_material.cpp
Expand Up @@ -519,7 +519,7 @@ FMaterial * FMaterial::ValidateTexture(FTexture * tex, bool expand, bool create)

FMaterial * FMaterial::ValidateTexture(FTextureID no, bool expand, bool translate, bool create)
{
return ValidateTexture(translate? TexMan(no) : TexMan[no], expand, create);
return ValidateTexture(TexMan.GetTexture(no, translate), expand, create);
}


Expand Down
2 changes: 1 addition & 1 deletion src/intermission/intermission.cpp
Expand Up @@ -568,7 +568,7 @@ void DIntermissionScreenCast::Drawer ()
}

sprframe = &SpriteFrames[sprites[castsprite].spriteframes + caststate->GetFrame()];
pic = TexMan(sprframe->Texture[0]);
pic = TexMan.GetTexture(sprframe->Texture[0], true);

screen->DrawTexture (pic, 160, 170,
DTA_320x200, true,
Expand Down
2 changes: 1 addition & 1 deletion src/p_3dmidtex.cpp
Expand Up @@ -229,7 +229,7 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do
side_t *side = line->sidedef[sideno];
FTextureID texnum = side->GetTexture(side_t::mid);
if (!texnum.isValid()) return false;
FTexture * tex= TexMan(texnum);
FTexture * tex= TexMan.GetTexture(texnum, true);
if (!tex) return false;

FTexCoordInfo tci;
Expand Down
6 changes: 3 additions & 3 deletions src/p_sectors.cpp
Expand Up @@ -1147,7 +1147,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
FTexture *tex = TexMan[GetTexture(sector_t::floor)];
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan(GetTexture(sector_t::floor));
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::floor), true);
if (tex->isGlowing()) // recheck the current animation frame.
{
tex->GetGlowColor(bottomglowcolor);
Expand Down Expand Up @@ -1192,7 +1192,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
FTexture *tex = TexMan[GetTexture(sector_t::ceiling)];
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan(GetTexture(sector_t::ceiling));
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::ceiling), true);
if (tex->isGlowing()) // recheck the current animation frame.
{
ret = true;
Expand All @@ -1216,7 +1216,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
FTexture *tex = TexMan[GetTexture(sector_t::floor)];
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan(GetTexture(sector_t::floor));
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::floor), true);
if (tex->isGlowing()) // recheck the current animation frame.
{
ret = true;
Expand Down
2 changes: 1 addition & 1 deletion src/polyrenderer/scene/poly_decal.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/polyrenderer/scene/poly_model.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/polyrenderer/scene/poly_plane.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/polyrenderer/scene/poly_playersprite.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/polyrenderer/scene/poly_sky.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/polyrenderer/scene/poly_sprite.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 79a0f76

Please sign in to comment.