diff --git a/src/am_map.cpp b/src/am_map.cpp index 379c4f7135b..932ec42edba 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -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, @@ -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. @@ -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]); } } @@ -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()]; diff --git a/src/d_main.cpp b/src/d_main.cpp index 39f7bd8e0c1..3f503683165 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -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, diff --git a/src/g_statusbar/sbarinfo_commands.cpp b/src/g_statusbar/sbarinfo_commands.cpp index f605e2dc426..6094f82eaf0 100644 --- a/src/g_statusbar/sbarinfo_commands.cpp +++ b/src/g_statusbar/sbarinfo_commands.cpp @@ -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; @@ -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) { @@ -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]; @@ -316,7 +316,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl spawnScaleY = item->Scale.Y; } - texture = TexMan(icon); + texture = TexMan.GetTexture(icon, true); } enum ImageType @@ -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) @@ -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); @@ -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); diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 06dd1e57ab9..37d30d176e0 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -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; diff --git a/src/gl/shaders/gl_postprocessshader.cpp b/src/gl/shaders/gl_postprocessshader.cpp index 6f13b899bc3..e57196462dd 100644 --- a/src/gl/shaders/gl_postprocessshader.cpp +++ b/src/gl/shaders/gl_postprocessshader.cpp @@ -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); diff --git a/src/hwrenderer/scene/hw_bsp.cpp b/src/hwrenderer/scene/hw_bsp.cpp index 4375bc7a13e..6198ce32cf3 100644 --- a/src/hwrenderer/scene/hw_bsp.cpp +++ b/src/hwrenderer/scene/hw_bsp.cpp @@ -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! diff --git a/src/hwrenderer/scene/hw_fakeflat.cpp b/src/hwrenderer/scene/hw_fakeflat.cpp index a70c74d0eec..510e7d48a37 100644 --- a/src/hwrenderer/scene/hw_fakeflat.cpp +++ b/src/hwrenderer/scene/hw_fakeflat.cpp @@ -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; @@ -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): @@ -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 && diff --git a/src/hwrenderer/scene/hw_sky.cpp b/src/hwrenderer/scene/hw_sky.cpp index 15d6b6f7cd1..c2c6b818981 100644 --- a/src/hwrenderer/scene/hw_sky.cpp +++ b/src/hwrenderer/scene/hw_sky.cpp @@ -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) { @@ -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) { @@ -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()) diff --git a/src/hwrenderer/scene/hw_sprites.cpp b/src/hwrenderer/scene/hw_sprites.cpp index 4d31c71d731..c3911b46017 100644 --- a/src/hwrenderer/scene/hw_sprites.cpp +++ b/src/hwrenderer/scene/hw_sprites.cpp @@ -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; diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index 47023d524aa..ef131ada437 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -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 && @@ -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 @@ -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) diff --git a/src/hwrenderer/scene/hw_weapon.cpp b/src/hwrenderer/scene/hw_weapon.cpp index 6cb719fae4f..1e18a6e2f8a 100644 --- a/src/hwrenderer/scene/hw_weapon.cpp +++ b/src/hwrenderer/scene/hw_weapon.cpp @@ -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; diff --git a/src/hwrenderer/textures/hw_material.cpp b/src/hwrenderer/textures/hw_material.cpp index fe1cda7cf77..ab833a71569 100644 --- a/src/hwrenderer/textures/hw_material.cpp +++ b/src/hwrenderer/textures/hw_material.cpp @@ -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); } diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 0477cb5afda..1cec8dbaa6f 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -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, diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index 7a2363be679..6b54d655877 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -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; diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index fd323e65f8f..43da7038f1e 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -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); @@ -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; @@ -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; diff --git a/src/polyrenderer/scene/poly_decal.cpp b/src/polyrenderer/scene/poly_decal.cpp index c91c48ad117..442c70de8e7 100644 --- a/src/polyrenderer/scene/poly_decal.cpp +++ b/src/polyrenderer/scene/poly_decal.cpp @@ -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; diff --git a/src/polyrenderer/scene/poly_model.cpp b/src/polyrenderer/scene/poly_model.cpp index 50deccdb694..a2f7875cb34 100644 --- a/src/polyrenderer/scene/poly_model.cpp +++ b/src/polyrenderer/scene/poly_model.cpp @@ -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; diff --git a/src/polyrenderer/scene/poly_plane.cpp b/src/polyrenderer/scene/poly_plane.cpp index 0f5a24235da..926092f5ca6 100644 --- a/src/polyrenderer/scene/poly_plane.cpp +++ b/src/polyrenderer/scene/poly_plane.cpp @@ -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; diff --git a/src/polyrenderer/scene/poly_playersprite.cpp b/src/polyrenderer/scene/poly_playersprite.cpp index dd4654aab93..a0a5dd597b3 100644 --- a/src/polyrenderer/scene/poly_playersprite.cpp +++ b/src/polyrenderer/scene/poly_playersprite.cpp @@ -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; diff --git a/src/polyrenderer/scene/poly_sky.cpp b/src/polyrenderer/scene/poly_sky.cpp index cf5fc755d8f..3e7cd072ceb 100644 --- a/src/polyrenderer/scene/poly_sky.cpp +++ b/src/polyrenderer/scene/poly_sky.cpp @@ -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(); diff --git a/src/polyrenderer/scene/poly_sprite.cpp b/src/polyrenderer/scene/poly_sprite.cpp index 73da1528b48..79ddf2312ad 100644 --- a/src/polyrenderer/scene/poly_sprite.cpp +++ b/src/polyrenderer/scene/poly_sprite.cpp @@ -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; diff --git a/src/polyrenderer/scene/poly_wall.cpp b/src/polyrenderer/scene/poly_wall.cpp index 297e549f42c..70472eef708 100644 --- a/src/polyrenderer/scene/poly_wall.cpp +++ b/src/polyrenderer/scene/poly_wall.cpp @@ -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(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()) diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index e8cb52678ac..6516ac5fda7 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -268,7 +268,7 @@ void FModelRenderer::RenderFrameModels(const FSpriteModelFrame *smf, const FStat if (smf->modelIDs[i] != -1) { FModel * mdl = Models[smf->modelIDs[i]]; - FTexture *tex = smf->skinIDs[i].isValid() ? TexMan(smf->skinIDs[i]) : nullptr; + FTexture *tex = smf->skinIDs[i].isValid() ? TexMan.GetTexture(smf->skinIDs[i], true) : nullptr; mdl->BuildVertexBuffer(this); mdl->PushSpriteMDLFrame(smf, i); diff --git a/src/r_data/models/models_md2.cpp b/src/r_data/models/models_md2.cpp index ce9566a8fcc..d203bf15a40 100644 --- a/src/r_data/models/models_md2.cpp +++ b/src/r_data/models/models_md2.cpp @@ -364,7 +364,7 @@ void FDMDModel::RenderFrame(FModelRenderer *renderer, FTexture * skin, int frame if (!skin) { if (info.numSkins == 0 || !skins[0].isValid()) return; - skin = TexMan(skins[0]); + skin = TexMan.GetTexture(skins[0], true); if (!skin) return; } diff --git a/src/r_data/models/models_md3.cpp b/src/r_data/models/models_md3.cpp index b3f12b853c8..67fcb38ef34 100644 --- a/src/r_data/models/models_md3.cpp +++ b/src/r_data/models/models_md3.cpp @@ -356,11 +356,11 @@ void FMD3Model::RenderFrame(FModelRenderer *renderer, FTexture * skin, int frame { if (curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].isValid()) { - surfaceSkin = TexMan(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i]); + surfaceSkin = TexMan.GetTexture(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i], true); } else if(surf->numSkins > 0 && surf->skins[0].isValid()) { - surfaceSkin = TexMan(surf->skins[0]); + surfaceSkin = TexMan.GetTexture(surf->skins[0], true); } if (!surfaceSkin) diff --git a/src/r_data/models/models_obj.cpp b/src/r_data/models/models_obj.cpp index b6adb29cf97..bbf8e3b5b7a 100644 --- a/src/r_data/models/models_obj.cpp +++ b/src/r_data/models/models_obj.cpp @@ -636,11 +636,11 @@ void FOBJModel::RenderFrame(FModelRenderer *renderer, FTexture * skin, int frame { if (i < MD3_MAX_SURFACES && curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].isValid()) { - userSkin = TexMan(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i]); + userSkin = TexMan.GetTexture(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i], true); } else if (surf->skin.isValid()) { - userSkin = TexMan(surf->skin); + userSkin = TexMan.GetTexture(surf->skin, true); } } diff --git a/src/r_data/models/models_ue1.cpp b/src/r_data/models/models_ue1.cpp index bd4f54e3d8c..c51dbc7fbbf 100644 --- a/src/r_data/models/models_ue1.cpp +++ b/src/r_data/models/models_ue1.cpp @@ -235,7 +235,7 @@ void FUE1Model::RenderFrame( FModelRenderer *renderer, FTexture *skin, int frame if ( !sskin ) { if ( curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum].isValid() ) - sskin = TexMan(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum]); + sskin = TexMan.GetTexture(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum], true); if ( !sskin ) { vofs += vsize; diff --git a/src/r_sky.cpp b/src/r_sky.cpp index 5b161dde102..94fb65644ef 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -80,8 +80,8 @@ void R_InitSkyMap() sky2texture = TexMan.CheckForTexture("-noflat-", ETextureType::Any); } - skytex1 = TexMan(sky1texture, true); - skytex2 = TexMan(sky2texture, true); + skytex1 = TexMan.GetTexture(sky1texture, false); + skytex2 = TexMan.GetTexture(sky2texture, false); if (skytex1 == nullptr) return; diff --git a/src/swrenderer/line/r_line.cpp b/src/swrenderer/line/r_line.cpp index f77971a2898..c3bc08d9f7e 100644 --- a/src/swrenderer/line/r_line.cpp +++ b/src/swrenderer/line/r_line.cpp @@ -451,7 +451,7 @@ namespace swrenderer lwal = draw_segment->maskedtexturecol; swal = draw_segment->swall; - FTexture *tex = TexMan(sidedef->GetTexture(side_t::mid), true); + FTexture *tex = TexMan.GetPalettedTexture(sidedef->GetTexture(side_t::mid), true); FSoftwareTexture *pic = tex && tex->isValid()? tex->GetSoftwareTexture() : nullptr; double yscale = pic->GetScale().Y * sidedef->GetTextureYScale(side_t::mid); fixed_t xoffset = FLOAT2FIXED(sidedef->GetTextureXOffset(side_t::mid)); @@ -770,7 +770,7 @@ namespace swrenderer } } - FTexture *ftex = TexMan(sidedef->GetTexture(side_t::mid), true); + FTexture *ftex = TexMan.GetPalettedTexture(sidedef->GetTexture(side_t::mid), true); FSoftwareTexture *midtex = ftex && ftex->isValid() ? ftex->GetSoftwareTexture() : nullptr; bool segtextured = midtex != NULL || mTopPart.Texture != NULL || mBottomPart.Texture != NULL; @@ -816,7 +816,7 @@ namespace swrenderer // No top texture for skyhack lines if (mFrontSector->GetTexture(sector_t::ceiling) == skyflatnum && mBackSector->GetTexture(sector_t::ceiling) == skyflatnum) return; - FTexture *tex = TexMan(sidedef->GetTexture(side_t::top), true); + FTexture *tex = TexMan.GetPalettedTexture(sidedef->GetTexture(side_t::top), true); mTopPart.Texture = tex && tex->isValid() ? tex->GetSoftwareTexture() : nullptr; mTopPart.TextureOffsetU = FLOAT2FIXED(sidedef->GetTextureXOffset(side_t::top)); @@ -874,7 +874,7 @@ namespace swrenderer if (linedef->isVisualPortal()) return; if (linedef->special == Line_Horizon) return; - auto tex = TexMan(sidedef->GetTexture(side_t::mid), true); + auto tex = TexMan.GetPalettedTexture(sidedef->GetTexture(side_t::mid), true); mMiddlePart.Texture = tex && tex->isValid() ? tex->GetSoftwareTexture() : nullptr; mMiddlePart.TextureOffsetU = FLOAT2FIXED(sidedef->GetTextureXOffset(side_t::mid)); double rowoffset = sidedef->GetTextureYOffset(side_t::mid); @@ -939,7 +939,7 @@ namespace swrenderer frontlowertop = mBackSector->GetPlaneTexZ(sector_t::ceiling); } - FTexture *tex = TexMan(sidedef->GetTexture(side_t::bottom), true);; + FTexture *tex = TexMan.GetPalettedTexture(sidedef->GetTexture(side_t::bottom), true); mBottomPart.Texture = tex && tex->isValid() ? tex->GetSoftwareTexture() : nullptr; if (!mBottomPart.Texture) return; diff --git a/src/swrenderer/line/r_renderdrawsegment.cpp b/src/swrenderer/line/r_renderdrawsegment.cpp index 060f40fa13e..eb23daad0b5 100644 --- a/src/swrenderer/line/r_renderdrawsegment.cpp +++ b/src/swrenderer/line/r_renderdrawsegment.cpp @@ -162,7 +162,7 @@ namespace swrenderer if (curline->sidedef->GetTexture(side_t::mid).isNull()) return false; - FTexture *ttex = TexMan(curline->sidedef->GetTexture(side_t::mid), true); + FTexture *ttex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::mid), true); if (i_compatflags & COMPATF_MASKEDMIDTEX) { ttex = ttex->GetRawTexture(); @@ -643,15 +643,15 @@ namespace swrenderer FTexture *rw_tex = nullptr; if (fover->flags & FF_UPPERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::top), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::top), true); } else if (fover->flags & FF_LOWERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::bottom), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::bottom), true); } else { - rw_tex = TexMan(fover->master->sidedef[0]->GetTexture(side_t::mid), true); + rw_tex = TexMan.GetPalettedTexture(fover->master->sidedef[0]->GetTexture(side_t::mid), true); } rw_pic = rw_tex && rw_tex->isValid() ? rw_tex->GetSoftwareTexture() : nullptr; } @@ -705,15 +705,15 @@ namespace swrenderer FTexture *rw_tex; if (rover->flags & FF_UPPERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::top), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::top), true); } else if (rover->flags & FF_LOWERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::bottom), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::bottom), true); } else { - rw_tex = TexMan(rover->master->sidedef[0]->GetTexture(side_t::mid), true); + rw_tex = TexMan.GetPalettedTexture(rover->master->sidedef[0]->GetTexture(side_t::mid), true); } rw_pic = rw_tex && rw_tex->isValid() ? rw_tex->GetSoftwareTexture() : nullptr; } @@ -832,15 +832,15 @@ namespace swrenderer FTexture *rw_tex; if (fover->flags & FF_UPPERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::top), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::top), true); } else if (fover->flags & FF_LOWERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::bottom), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::bottom), true); } else { - rw_tex = TexMan(fover->master->sidedef[0]->GetTexture(side_t::mid), true); + rw_tex = TexMan.GetPalettedTexture(fover->master->sidedef[0]->GetTexture(side_t::mid), true); } rw_pic = rw_tex && rw_tex->isValid() ? rw_tex->GetSoftwareTexture() : nullptr; } @@ -891,15 +891,15 @@ namespace swrenderer FTexture *rw_tex; if (rover->flags & FF_UPPERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::top), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::top), true); } else if (rover->flags & FF_LOWERTEXTURE) { - rw_tex = TexMan(curline->sidedef->GetTexture(side_t::bottom), true); + rw_tex = TexMan.GetPalettedTexture(curline->sidedef->GetTexture(side_t::bottom), true); } else { - rw_tex = TexMan(rover->master->sidedef[0]->GetTexture(side_t::mid), true); + rw_tex = TexMan.GetPalettedTexture(rover->master->sidedef[0]->GetTexture(side_t::mid), true); } rw_pic = rw_tex && rw_tex->isValid() ? rw_tex->GetSoftwareTexture() : nullptr; } diff --git a/src/swrenderer/plane/r_skyplane.cpp b/src/swrenderer/plane/r_skyplane.cpp index feac5b5dafb..4f444ece54c 100644 --- a/src/swrenderer/plane/r_skyplane.cpp +++ b/src/swrenderer/plane/r_skyplane.cpp @@ -65,8 +65,8 @@ fixed_t sky1cyl, sky2cyl; void InitSoftwareSky() { - auto skytex1 = TexMan(sky1texture, true); - auto skytex2 = TexMan(sky2texture, true); + auto skytex1 = TexMan.GetPalettedTexture(sky1texture, true); + auto skytex2 = TexMan.GetPalettedTexture(sky2texture, true); if (skytex1 == nullptr) return; @@ -118,7 +118,7 @@ namespace swrenderer 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(); diff --git a/src/swrenderer/plane/r_visibleplane.cpp b/src/swrenderer/plane/r_visibleplane.cpp index 6ba69d90c8c..72e83881295 100644 --- a/src/swrenderer/plane/r_visibleplane.cpp +++ b/src/swrenderer/plane/r_visibleplane.cpp @@ -113,7 +113,7 @@ namespace swrenderer } else // regular flat { - FTexture *ttex = TexMan(picnum, true); + FTexture *ttex = TexMan.GetPalettedTexture(picnum, true); if (!ttex->isValid()) { diff --git a/src/swrenderer/scene/r_opaque_pass.cpp b/src/swrenderer/scene/r_opaque_pass.cpp index ccdfb578411..e2a8c7877d4 100644 --- a/src/swrenderer/scene/r_opaque_pass.cpp +++ b/src/swrenderer/scene/r_opaque_pass.cpp @@ -1023,7 +1023,7 @@ namespace swrenderer { sprite.picnum = thing->picnum; - sprite.tex = TexMan(sprite.picnum); + sprite.tex = TexMan.GetPalettedTexture(sprite.picnum, true); if (!sprite.tex->isValid()) { return false; diff --git a/src/swrenderer/things/r_decal.cpp b/src/swrenderer/things/r_decal.cpp index 0f2e15296a9..a0a77da0ddd 100644 --- a/src/swrenderer/things/r_decal.cpp +++ b/src/swrenderer/things/r_decal.cpp @@ -129,7 +129,7 @@ namespace swrenderer } } - FTexture *tex = TexMan(decal->PicNum, true); + FTexture *tex = TexMan.GetPalettedTexture(decal->PicNum, true); flipx = (uint8_t)(decal->RenderFlags & RF_XFLIP); if (tex == NULL || !tex->isValid()) diff --git a/src/swrenderer/things/r_model.cpp b/src/swrenderer/things/r_model.cpp index 26d54f104ed..938b5f20cff 100644 --- a/src/swrenderer/things/r_model.cpp +++ b/src/swrenderer/things/r_model.cpp @@ -106,7 +106,7 @@ namespace swrenderer 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; diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 6322ef63716..3020ce07c3a 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -224,7 +224,7 @@ namespace swrenderer picnum = sprframe->Texture[0]; flip = sprframe->Flip & 1; - tex = TexMan(picnum); + tex = TexMan.GetTexture(picnum, true); if (!tex->isValid()) return; diff --git a/src/textures/textures.h b/src/textures/textures.h index e75ce0a8a3a..e8eca3b0d9d 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -566,41 +566,40 @@ class FTextureManager return Textures[texnum.GetIndex()].Texture; } + // This only gets used in UI code so we do not need PALVERS handling. FTexture *GetTextureByName(const char *name, bool animate = false) { FTextureID texnum = GetTextureID (name, ETextureType::MiscPatch); if (!texnum.Exists()) return nullptr; if (!animate) return Textures[texnum.GetIndex()].Texture; else return Textures[Translation[texnum.GetIndex()]].Texture; - } - FTexture *ByIndex(int i) + FTexture *GetTexture(FTextureID texnum, bool animate) { - if (unsigned(i) >= Textures.Size()) return NULL; - return Textures[i].Texture; + if ((size_t)texnum.texnum >= Textures.Size()) return nullptr; + if (animate) texnum = Translation[texnum.GetIndex()]; + return Textures[texnum.GetIndex()].Texture; } - FTexture *FindTexture(const char *texname, ETextureType usetype = ETextureType::MiscPatch, BITFIELD flags = TEXMAN_TryAny); - - // Get texture with translation - FTexture *operator() (FTextureID texnum, bool withpalcheck=false) + + // This is the only access function that should be used inside the software renderer. + FTexture *GetPalettedTexture(FTextureID texnum, bool animate) { - if ((size_t)texnum.texnum >= Textures.Size()) return NULL; - int picnum = Translation[texnum.texnum]; - if (withpalcheck) - { - picnum = PalCheck(picnum).GetIndex(); - } - return Textures[picnum].Texture; + if ((size_t)texnum.texnum >= Textures.Size()) return nullptr; + if (animate) texnum = Translation[texnum.GetIndex()]; + texnum = PalCheck(texnum).GetIndex(); + return Textures[texnum.GetIndex()].Texture; } - /* - FTexture *operator() (const char *texname) + + FTexture *ByIndex(int i, bool animate = false) { - FTextureID texnum = GetTextureID (texname, ETextureType::MiscPatch); - if (texnum.texnum == -1) return NULL; - return Textures[Translation[texnum.texnum]].Texture; + if (unsigned(i) >= Textures.Size()) return NULL; + if (animate) i = Translation[i]; + return Textures[i].Texture; } - */ + FTexture *FindTexture(const char *texname, ETextureType usetype = ETextureType::MiscPatch, BITFIELD flags = TEXMAN_TryAny); + + //public: diff --git a/src/v_collection.cpp b/src/v_collection.cpp index 95f35097ad5..053eeec45d0 100644 --- a/src/v_collection.cpp +++ b/src/v_collection.cpp @@ -77,5 +77,5 @@ FTexture *FImageCollection::operator[] (int index) const { return NULL; } - return ImageMap[index].Exists()? TexMan(ImageMap[index]) : NULL; + return ImageMap[index].Exists()? TexMan.GetPalettedTexture(ImageMap[index], true) : NULL; } diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 00c6307efa3..442705e719d 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -175,7 +175,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawTexture) if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - FTexture *tex = animate ? TexMan(FSetTextureID(texid)) : TexMan[FSetTextureID(texid)]; + FTexture *tex = TexMan.ByIndex(texid, animate); VMVa_List args = { param + 4, 0, numparam - 5, va_reginfo + 4 }; screen->DrawTexture(tex, x, y, args); return 0; @@ -231,7 +231,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawShape) if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - FTexture *tex = animate ? TexMan(FSetTextureID(texid)) : TexMan[FSetTextureID(texid)]; + FTexture *tex = TexMan.ByIndex(texid, animate); VMVa_List args = { param + 3, 0, numparam - 4, va_reginfo + 3 }; screen->DrawShape(tex, shape, args); @@ -1354,7 +1354,7 @@ void DFrameBuffer::DrawBorder (int x1, int y1, int x2, int y2) if (picnum.isValid()) { - FlatFill (x1, y1, x2, y2, TexMan(picnum)); + FlatFill (x1, y1, x2, y2, TexMan.GetTexture(picnum, false)); } else { diff --git a/src/v_font.cpp b/src/v_font.cpp index 4985b240733..c875c6eec35 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -1519,7 +1519,7 @@ FTexture *FSinglePicFont::GetChar (int code, int *const width) const *width = SpaceWidth; if (code == 'a' || code == 'A') { - return TexMan(PicNum); + return TexMan.GetPalettedTexture(PicNum, true); } else { diff --git a/wadsrc/static/zscript/statusbar/alt_hud.txt b/wadsrc/static/zscript/statusbar/alt_hud.txt index 6f7a5f8dd1d..ccc9b568d58 100644 --- a/wadsrc/static/zscript/statusbar/alt_hud.txt +++ b/wadsrc/static/zscript/statusbar/alt_hud.txt @@ -674,7 +674,7 @@ class AltHud ui { double trans = rover == CPlayer.mo.InvSel ? 1.0 : 0.4; - DrawImageToBox(AltIcon.isValid()? AltIcon : rover.Icon, x, y, 19, 25, trans); + DrawImageToBox(AltIcon.isValid()? AltIcon : rover.Icon, x, y, 19, 25, trans, true); if (rover.Amount > 1) { int xx; @@ -989,4 +989,4 @@ class AltHud ui } } -} \ No newline at end of file +}