- replaced the last access operator, too

Now everything uses a function.
This really wasn't what operators are supposef to be used for.
This commit is contained in:
Christoph Oelckers 2018-12-07 03:01:40 +01:00
parent 42b18e6dfb
commit 9409843931
30 changed files with 71 additions and 79 deletions

View file

@ -1194,7 +1194,7 @@ static void AM_ScrollParchment (double dmapx, double dmapy)
if (mapback.isValid())
{
FTexture *backtex = TexMan[mapback];
FTexture *backtex = TexMan.GetTexture(mapback);
if (backtex != NULL)
{
@ -1689,7 +1689,7 @@ void AM_clearFB (const AMColor &color)
}
else
{
FTexture *backtex = TexMan[mapback];
FTexture *backtex = TexMan.GetTexture(mapback);
if (backtex != NULL)
{
int pwidth = backtex->GetDisplayWidth();
@ -3189,7 +3189,7 @@ void AM_drawAuthorMarkers ()
spriteframe_t *sprframe = &SpriteFrames[tex->GetRotations()];
picnum = sprframe->Texture[0];
flip = sprframe->Flip & 1;
tex = TexMan[picnum];
tex = TexMan.GetTexture(picnum);
}
}
else
@ -3204,7 +3204,7 @@ void AM_drawAuthorMarkers ()
spriteframe_t *sprframe = &SpriteFrames[sprdef->spriteframes + mark->frame];
picnum = sprframe->Texture[0];
flip = sprframe->Flip & 1;
tex = TexMan[picnum];
tex = TexMan.GetTexture(picnum);
}
}
FActorIterator it (mark->args[0]);

View file

@ -1083,7 +1083,7 @@ void C_DrawConsole ()
else if (ConBottom)
{
int visheight;
FTexture *conpic = TexMan[conback];
FTexture *conpic = TexMan.GetTexture(conback);
visheight = ConBottom;

View file

@ -856,7 +856,7 @@ void D_Display ()
D_DrawIcon = NULL;
if (picnum.isValid())
{
FTexture *tex = TexMan[picnum];
FTexture *tex = TexMan.GetTexture(picnum);
screen->DrawTexture (tex, 160 - tex->GetDisplayWidth()/2, 100 - tex->GetDisplayHeight()/2,
DTA_320x200, true, TAG_DONE);
}

View file

@ -1903,7 +1903,7 @@ void FParser::SF_FloorTexture(void)
}
t_return.type = svt_string;
FTexture * tex = TexMan[sector->GetTexture(sector_t::floor)];
FTexture * tex = TexMan.GetTexture(sector->GetTexture(sector_t::floor));
t_return.string = tex? tex->GetName() : "";
}
}
@ -1993,7 +1993,7 @@ void FParser::SF_CeilingTexture(void)
}
t_return.type = svt_string;
FTexture * tex = TexMan[sector->GetTexture(sector_t::ceiling)];
FTexture * tex = TexMan.GetTexture(sector->GetTexture(sector_t::ceiling));
t_return.string = tex? tex->GetName() : "";
}
}

View file

@ -262,7 +262,7 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, double x, double y, F3DFloor *
else return FNullTextureID();
CalcFracPos (wall, x, y);
FTexture *texture = TexMan[tex];
FTexture *texture = TexMan.GetTexture(tex);
if (texture == NULL || texture->allowNoDecals())
{
@ -492,7 +492,7 @@ void DBaseDecal::Spread (const FDecalTemplate *tpl, side_t *wall, double x, doub
GetWallStuff (wall, v1, ldx, ldy);
rorg = Length (x - v1->fX(), y - v1->fY());
if ((tex = TexMan[PicNum]) == NULL)
if ((tex = TexMan.GetTexture(PicNum)) == NULL)
{
return;
}

View file

@ -937,7 +937,7 @@ CCMD(listlights)
if (dl->target)
{
FTextureID spr = sprites[dl->target->sprite].GetSpriteFrame(dl->target->frame, 0, 0., nullptr);
Printf(", frame = %s ", TexMan[spr]->GetName().GetChars());
Printf(", frame = %s ", TexMan.GetTexture(spr)->GetName().GetChars());
}

View file

@ -96,7 +96,7 @@ FTexture *FMugShotFrame::GetTexture(const char *default_face, const char *skin_f
}
sprite.UnlockBuffer();
}
return TexMan[TexMan.CheckForTexture(sprite, ETextureType::Any, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_AllowSkins)];
return TexMan.GetTexture(TexMan.CheckForTexture(sprite, ETextureType::Any, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_AllowSkins));
}
//===========================================================================

View file

@ -203,7 +203,7 @@ void ST_LoadCrosshair(bool alwaysload)
}
}
CrosshairNum = num;
CrosshairImage = TexMan[texid];
CrosshairImage = TexMan.GetTexture(texid);
}
//---------------------------------------------------------------------------

View file

@ -209,7 +209,7 @@ void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth, int &maxiconheigh
}
if (players[i].mo->ScoreIcon.isValid())
{
FTexture *pic = TexMan[players[i].mo->ScoreIcon];
FTexture *pic = TexMan.GetTexture(players[i].mo->ScoreIcon);
width = pic->GetDisplayWidth() - pic->GetDisplayLeftOffset() + 2;
if (width > maxscorewidth)
{
@ -422,7 +422,7 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2,
if (player->mo->ScoreIcon.isValid())
{
FTexture *pic = TexMan[player->mo->ScoreIcon];
FTexture *pic = TexMan.GetTexture(player->mo->ScoreIcon);
screen->DrawTexture (pic, col3, y,
DTA_CleanNoMove, true,
TAG_DONE);

View file

@ -208,7 +208,7 @@ void GLWall::ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &nor
flipy = !!(decal->RenderFlags & RF_YFLIP);
FTexture *texture = TexMan[decalTile];
FTexture *texture = TexMan.GetTexture(decalTile);
if (texture == NULL) return;

View file

@ -350,7 +350,7 @@ bool HWDrawInfo::DoOneSectorUpper(subsector_t * subsec, float Planez, area_t in_
if (sec->GetPlaneTexZ(sector_t::ceiling) == Planez)
{
// If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::top)];
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::top));
if (!tex || !tex->isValid()) continue;
else return false;
}
@ -408,7 +408,7 @@ bool HWDrawInfo::DoOneSectorLower(subsector_t * subsec, float Planez, area_t in_
if (sec->GetPlaneTexZ(sector_t::floor) == Planez)
{
// If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::bottom)];
FTexture * tex = TexMan.GetTexture(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || !tex->isValid()) continue;
else return false;
}

View file

@ -162,11 +162,11 @@ void DIntermissionScreen::Drawer ()
{
if (!mFlatfill)
{
screen->DrawTexture (TexMan[mBackground], 0, 0, DTA_Fullscreen, true, TAG_DONE);
screen->DrawTexture (TexMan.GetTexture(mBackground), 0, 0, DTA_Fullscreen, true, TAG_DONE);
}
else
{
screen->FlatFill (0,0, SCREENWIDTH, SCREENHEIGHT, TexMan[mBackground]);
screen->FlatFill (0,0, SCREENWIDTH, SCREENHEIGHT, TexMan.GetTexture(mBackground));
}
}
else
@ -176,7 +176,7 @@ void DIntermissionScreen::Drawer ()
for (unsigned i=0; i < mOverlays.Size(); i++)
{
if (CheckOverlay(i))
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
screen->DrawTexture (TexMan.GetTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE);
}
if (!mFlatfill) screen->FillBorder (NULL);
}
@ -229,11 +229,11 @@ void DIntermissionScreenFader::Drawer ()
if (mType == FADE_In) factor = 1.0 - factor;
int color = MAKEARGB(int(factor*255), 0,0,0);
screen->DrawTexture (TexMan[mBackground], 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
screen->DrawTexture (TexMan.GetTexture(mBackground), 0, 0, DTA_Fullscreen, true, DTA_ColorOverlay, color, TAG_DONE);
for (unsigned i=0; i < mOverlays.Size(); i++)
{
if (CheckOverlay(i))
screen->DrawTexture (TexMan[mOverlays[i].mPic], mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
screen->DrawTexture (TexMan.GetTexture(mOverlays[i].mPic), mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, DTA_ColorOverlay, color, TAG_DONE);
}
screen->FillBorder (NULL);
}
@ -611,8 +611,8 @@ int DIntermissionScreenScroller::Responder (event_t *ev)
void DIntermissionScreenScroller::Drawer ()
{
FTexture *tex = TexMan[mFirstPic];
FTexture *tex2 = TexMan[mSecondPic];
FTexture *tex = TexMan.GetTexture(mFirstPic);
FTexture *tex2 = TexMan.GetTexture(mSecondPic);
if (mTicker >= mScrollDelay && mTicker < mScrollDelay + mScrollTime && tex != NULL && tex2 != NULL)
{

View file

@ -4574,10 +4574,10 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
{
return 0;
}
FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string), ETextureType::Flat,
FTextureID tex = TexMan.CheckForTexture(FBehavior::StaticLookupString(string), ETextureType::Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_DontCreate);
if (tex == NULL)
if (!tex.Exists())
{ // If the texture we want to check against doesn't exist, then
// they're obviously not the same.
return 0;
@ -4596,7 +4596,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
NextHighestCeilingAt(actor->Sector, actor->X(), actor->Y(), actor->Z(), actor->Top(), 0, &resultsec, &resffloor);
secpic = resffloor ? *resffloor->bottom.texture : resultsec->planes[sector_t::ceiling].Texture;
}
return tex == TexMan[secpic];
return tex == secpic;
}
@ -6690,7 +6690,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
auto a = SingleActorFromTID(args[0], activator);
if (a != nullptr)
{
return GlobalACSStrings.AddString(TexMan[a->floorpic]->GetName());
return GlobalACSStrings.AddString(TexMan.GetTexture(a->floorpic)->GetName());
}
else
{

View file

@ -293,7 +293,7 @@ void DDoor::DoorSound(bool raise, DSeqNode *curseq) const
if (line->backsector == NULL)
continue;
FTexture *tex = TexMan[line->sidedef[0]->GetTexture(side_t::top)];
FTexture *tex = TexMan.GetTexture(line->sidedef[0]->GetTexture(side_t::top));
texname = tex ? tex->GetName().GetChars() : NULL;
if (texname != NULL && texname[0] == 'D' && texname[1] == 'O' && texname[2] == 'R')
{
@ -715,7 +715,7 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay,
picnum = tex1[side_t::top].texture;
FTexture *tex = TexMan[picnum];
FTexture *tex = TexMan.GetTexture(picnum);
topdist = tex ? tex->GetDisplayHeight() : 64;
topdist = m_Sector->ceilingplane.fD() - topdist * m_Sector->ceilingplane.fC();

View file

@ -477,7 +477,7 @@ static inline void CheckShortestTex (FTextureID texnum, double &minsize)
{
if (texnum.isValid() || (texnum.isNull() && (i_compatflags & COMPATF_SHORTTEX)))
{
FTexture *tex = TexMan[texnum];
FTexture *tex = TexMan.GetTexture(texnum);
if (tex != NULL)
{
double h = tex->GetDisplayHeight();
@ -1144,7 +1144,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
auto c = planes[sector_t::floor].GlowColor;
if (c == 0)
{
FTexture *tex = TexMan[GetTexture(sector_t::floor)];
FTexture *tex = TexMan.GetTexture(GetTexture(sector_t::floor));
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::floor), true);
@ -1189,7 +1189,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
auto c = planes[sector_t::ceiling].GlowColor;
if (c == 0)
{
FTexture *tex = TexMan[GetTexture(sector_t::ceiling)];
FTexture *tex = TexMan.GetTexture(GetTexture(sector_t::ceiling));
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::ceiling), true);
@ -1213,7 +1213,7 @@ double GetFriction(const sector_t *self, int plane, double *pMoveFac)
c = planes[sector_t::floor].GlowColor;
if (c == 0)
{
FTexture *tex = TexMan[GetTexture(sector_t::floor)];
FTexture *tex = TexMan.GetTexture(GetTexture(sector_t::floor));
if (tex != NULL && tex->isGlowing())
{
if (!tex->isAutoGlowing()) tex = TexMan.GetTexture(GetTexture(sector_t::floor), true);

View file

@ -227,7 +227,7 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
picnum = sprframe->Texture[0];
flip = sprframe->Flip & 1;
ttex = TexMan.GetPalettedTexture(picnum, true);
ttex = TexMan.GetTexture(picnum);
if (!ttex->isValid())
return;

View file

@ -336,7 +336,7 @@ FSoftwareTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool
rot = (ang - thing->Angles.Yaw + (45.0 / 2 * 9 - 180.0 / 16)).BAMs() >> 28;
}
flipX = (sprframe->Flip & (1 << rot)) != 0;
ttex = TexMan[sprframe->Texture[rot]]; // Do not animate the rotation
ttex = TexMan.GetPalettedTexture(sprframe->Texture[rot], false); // Do not animate the rotation
tex = ttex->GetSoftwareTexture();
if (!ttex || !ttex->isValid())
{
@ -371,7 +371,7 @@ FSoftwareTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool
DAngle sprangle = thing->GetSpriteAngle((pos - viewpoint.Pos).Angle(), viewpoint.TicFrac);
FTextureID tex = sprdef->GetSpriteFrame(thing->frame, -1, sprangle, &flipX);
if (!tex.isValid()) return nullptr;
return TexMan[tex]->GetSoftwareTexture();
return TexMan.GetPalettedTexture(tex, false)->GetSoftwareTexture();
}
}
}

View file

@ -977,7 +977,7 @@ class GLDefsParser
sc.MustGetString();
if (facecount<6)
{
sb->faces[facecount] = TexMan[TexMan.GetTextureID(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_Overridable)];
sb->faces[facecount] = TexMan.GetTexture(TexMan.GetTextureID(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_Overridable));
}
facecount++;
}
@ -1008,7 +1008,7 @@ class GLDefsParser
{
sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Flat,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump];
FTexture *tex = TexMan.GetTexture(flump);
if (tex) tex->bAutoGlowing = tex->bGlowing = tex->bFullbright = true;
}
}
@ -1019,7 +1019,7 @@ class GLDefsParser
{
sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Wall,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump];
FTexture *tex = TexMan.GetTexture(flump);
if (tex) tex->bAutoGlowing = tex->bGlowing = tex->bFullbright = true;
}
}
@ -1028,7 +1028,7 @@ class GLDefsParser
sc.SetCMode(true);
sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Flat,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump];
FTexture *tex = TexMan.GetTexture(flump);
sc.MustGetStringName(",");
sc.MustGetString();
PalEntry color = V_GetColor(NULL, sc.String);
@ -1081,7 +1081,7 @@ class GLDefsParser
sc.MustGetString();
FTextureID no = TexMan.CheckForTexture(sc.String, type, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_Overridable);
FTexture *tex = TexMan[no];
FTexture *tex = TexMan.GetTexture(no);
sc.MustGetToken('{');
while (!sc.CheckToken('}'))
@ -1186,7 +1186,7 @@ class GLDefsParser
sc.MustGetString();
FTextureID no = TexMan.CheckForTexture(sc.String, type, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_Overridable);
FTexture *tex = TexMan[no];
FTexture *tex = TexMan.GetTexture(no);
sc.MustGetToken('{');
while (!sc.CheckToken('}'))
@ -1489,7 +1489,7 @@ class GLDefsParser
sc.MustGetString();
FTextureID no = TexMan.CheckForTexture(sc.String, type);
FTexture *tex = TexMan[no];
FTexture *tex = TexMan.GetTexture(no);
sc.MustGetToken('{');
while (!sc.CheckToken('}'))

View file

@ -122,7 +122,7 @@ static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool
if (frame >= MAX_SPRITE_FRAMES || rotation > 16)
{
Printf (TEXTCOLOR_RED "R_InstallSpriteLump: Bad frame characters in lump %s\n", TexMan[lump]->GetName().GetChars());
Printf (TEXTCOLOR_RED "R_InstallSpriteLump: Bad frame characters in lump %s\n", TexMan.GetTexture(lump)->GetName().GetChars());
return false;
}
@ -286,7 +286,7 @@ void R_InstallSprite (int num, spriteframewithrotate *sprtemp, int &maxframe)
{
for (int rot = 0; rot < 16; ++rot)
{
TexMan[sprtemp[frame].Texture[rot]]->Rotations = framestart + frame;
TexMan.GetTexture(sprtemp[frame].Texture[rot])->Rotations = framestart + frame;
}
}
}
@ -414,7 +414,7 @@ void R_InitSpriteDefs ()
int hash = hashes[intname % smax].Head;
while (hash != -1)
{
FTexture *tex = TexMan[hash];
FTexture *tex = TexMan.GetTexture(hash);
if (TEX_DWNAME(tex) == intname)
{
bool res = R_InstallSpriteLump (FTextureID(hash), tex->Name[4] - 'A', tex->Name[5], false, sprtemp, maxframe);

View file

@ -1069,7 +1069,7 @@ void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, double fov)
{
return;
}
texture = static_cast<FCanvasTexture *>(TexMan[picnum]);
texture = static_cast<FCanvasTexture *>(TexMan.GetTexture(picnum));
if (!texture->bHasCanvas)
{
Printf ("%s is not a valid target for a camera\n", texture->Name.GetChars());
@ -1109,7 +1109,7 @@ void SetCameraToTexture(AActor *viewpoint, const FString &texturename, double fo
if (textureid.isValid())
{
// Only proceed if the texture actually has a canvas.
FTexture *tex = TexMan[textureid];
FTexture *tex = TexMan.GetTexture(textureid);
if (tex && tex->isCanvas())
{
FCanvasTextureInfo::Add(viewpoint, textureid, fov);

View file

@ -53,7 +53,7 @@ static void CastCo2S(FString *a, int b) { PalEntry c(b); a->Format("%02x %02x %0
static int CastS2So(FString *b) { return FSoundID(*b); }
static void CastSo2S(FString *a, int b) { *a = S_sfx[b].name; }
static void CastSID2S(FString *a, unsigned int b) { *a = (b >= sprites.Size()) ? "TNT1" : sprites[b].name; }
static void CastTID2S(FString *a, int b) { auto tex = TexMan[*(FTextureID*)&b]; *a = (tex == nullptr) ? "(null)" : tex->GetName().GetChars(); }
static void CastTID2S(FString *a, int b) { auto tex = TexMan.GetTexture(*(FTextureID*)&b); *a = (tex == nullptr) ? "(null)" : tex->GetName().GetChars(); }
void JitCompiler::EmitCAST()
{

View file

@ -1874,7 +1874,7 @@ static void DoCast(const VMRegisters &reg, const VMFrame *f, int a, int b, int c
case CAST_TID2S:
{
ASSERTS(a); ASSERTD(b);
auto tex = TexMan[*(FTextureID*)&(reg.d[b])];
auto tex = TexMan.GetTexture(*(FTextureID*)&(reg.d[b]));
reg.s[a] = tex == nullptr ? "(null)" : tex->GetName().GetChars();
break;
}

View file

@ -1515,7 +1515,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
}
FTextureID chk = value;
if (chk.GetIndex() >= TexMan.NumTextures()) chk.SetNull();
FTexture *pic = TexMan[chk];
FTexture *pic = TexMan.GetTexture(chk);
const char *name;
if (Wads.GetLinkedTexture(pic->SourceLump) == pic)

View file

@ -1054,7 +1054,7 @@ namespace swrenderer
{
sprite.renderflags ^= RF_XFLIP;
}
sprite.tex = TexMan[sprite.picnum]; // Do not animate the rotation
sprite.tex = TexMan.GetPalettedTexture(sprite.picnum, false); // Do not animate the rotation
}
}
else
@ -1084,7 +1084,7 @@ namespace swrenderer
{
sprite.renderflags ^= RF_XFLIP;
}
sprite.tex = TexMan[tex]; // Do not animate the rotation
sprite.tex = TexMan.GetPalettedTexture(tex, false); // Do not animate the rotation
}
if (r_drawvoxels)

View file

@ -224,7 +224,7 @@ namespace swrenderer
picnum = sprframe->Texture[0];
flip = sprframe->Flip & 1;
tex = TexMan.GetTexture(picnum, true);
tex = TexMan.GetTexture(picnum);
if (!tex->isValid())
return;

View file

@ -1234,7 +1234,7 @@ void FMultiPatchTexture::ResolvePatches()
TexMan.ListTextures(Inits[i].TexName, list, true);
for (int i = list.Size() - 1; i >= 0; i--)
{
if (list[i] != id && !TexMan[list[i]]->bMultiPatch)
if (list[i] != id && !TexMan.GetTexture(list[i])->bMultiPatch)
{
texno = list[i];
break;
@ -1263,7 +1263,7 @@ void FMultiPatchTexture::ResolvePatches()
}
else
{
Parts[i].Texture = TexMan[texno];
Parts[i].Texture = TexMan.GetTexture(texno);
bComplex |= Parts[i].Texture->bComplex;
Parts[i].Texture->bKeepAround = true;
if (Inits[i].UseOffsets)

View file

@ -1116,8 +1116,8 @@ void FTextureManager::InitPalettedVersions()
}
if (pic1.isValid() && pic2.isValid())
{
FTexture *owner = TexMan[pic1];
FTexture *owned = TexMan[pic2];
FTexture *owner = GetTexture(pic1);
FTexture *owned = GetTexture(pic2);
if (owner && owned) owner->PalVersion = owned;
}
@ -1135,7 +1135,7 @@ FTextureID FTextureManager::PalCheck(FTextureID tex)
{
// In any true color mode this shouldn't do anything.
if (vid_nopalsubstitutions || V_IsTrueColor()) return tex;
auto ftex = operator[](tex);
auto ftex = GetTexture(tex);
if (ftex != nullptr && ftex->PalVersion != nullptr) return ftex->PalVersion->id;
return tex;
}
@ -1259,7 +1259,7 @@ void FTextureManager::AdjustSpriteOffsets()
Wads.GetLumpName(str, i);
str[8] = 0;
FTextureID texid = TexMan.CheckForTexture(str, ETextureType::Sprite, 0);
if (texid.isValid() && Wads.GetLumpFile(TexMan[texid]->SourceLump) > Wads.GetIwadNum())
if (texid.isValid() && Wads.GetLumpFile(GetTexture(texid)->SourceLump) > Wads.GetIwadNum())
{
// This texture has been replaced by some PWAD.
memcpy(&sprid, str, 4);
@ -1294,7 +1294,7 @@ void FTextureManager::AdjustSpriteOffsets()
}
if (texno.isValid())
{
FTexture * tex = TexMan[texno];
FTexture * tex = GetTexture(texno);
int lumpnum = tex->GetSourceLump();
// We only want to change texture offsets for sprites in the IWAD or the file this lump originated from.

View file

@ -558,14 +558,6 @@ public:
FTextureManager ();
~FTextureManager ();
// Get texture without translation
//private:
FTexture *operator[] (FTextureID texnum)
{
if ((unsigned)texnum.GetIndex() >= Textures.Size()) return NULL;
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)
{
@ -575,9 +567,9 @@ public:
else return Textures[Translation[texnum.GetIndex()]].Texture;
}
FTexture *GetTexture(FTextureID texnum, bool animate)
FTexture *GetTexture(FTextureID texnum, bool animate = false)
{
if ((size_t)texnum.texnum >= Textures.Size()) return nullptr;
if ((size_t)texnum.GetIndex() >= Textures.Size()) return nullptr;
if (animate) texnum = Translation[texnum.GetIndex()];
return Textures[texnum.GetIndex()].Texture;
}

View file

@ -384,7 +384,7 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
!TexMan.CheckForTexture("STCFN122", ETextureType::MiscPatch).isValid())
{
// insert the incorrectly named '|' graphic in its correct position.
if (count > 124-start) charLumps[124-start] = TexMan[lump];
if (count > 124-start) charLumps[124-start] = TexMan.GetTexture(lump);
lump.SetInvalid();
stcfn121 = true;
}
@ -392,7 +392,7 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
if (lump.isValid())
{
FTexture *pic = TexMan[lump];
FTexture *pic = TexMan.GetTexture(lump);
if (pic != NULL)
{
// set the lump here only if it represents a valid texture
@ -994,7 +994,7 @@ FSingleLumpFont::FSingleLumpFont (const char *name, int lump) : FFont(lump)
void FSingleLumpFont::CreateFontFromPic (FTextureID picnum)
{
FTexture *pic = TexMan[picnum];
FTexture *pic = TexMan.GetTexture(picnum);
FontHeight = pic->GetDisplayHeight ();
SpaceWidth = pic->GetDisplayWidth ();
@ -1492,7 +1492,7 @@ FSinglePicFont::FSinglePicFont(const char *picname) :
I_FatalError ("%s is not a font or texture", picname);
}
FTexture *pic = TexMan[picnum];
FTexture *pic = TexMan.GetTexture(picnum);
FontName = picname;
FontHeight = pic->GetDisplayHeight();
@ -2143,7 +2143,7 @@ void V_InitCustomFonts()
FTextureID texid = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
if (texid.Exists())
{
*p = TexMan[texid];
*p = TexMan.GetTexture(texid);
}
else if (Wads.GetLumpFile(sc.LumpNum) >= Wads.GetIwadNum())
{

View file

@ -519,7 +519,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
texture = TexMan.GetTextureID("INTERPIC", ETextureType::MiscPatch);
}
}
background = TexMan[texture];
background = TexMan.GetTexture(texture);
return noautostartmap;
}