From a76494363cfd131d64cc3132db90727ef443124d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 May 2023 12:40:34 +0200 Subject: [PATCH] - get rid of 'picnum' in common code. --- source/common/2d/v_2ddrawer.h | 2 +- source/common/2d/v_draw.cpp | 6 +++--- source/common/fonts/singlepicfont.cpp | 8 ++++---- source/common/fonts/v_font.cpp | 6 +++--- source/common/textures/texturemanager.cpp | 4 ++-- source/common/textures/texturemanager.h | 2 +- source/common/textures/v_collection.cpp | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/common/2d/v_2ddrawer.h b/source/common/2d/v_2ddrawer.h index 7203ca3c1..fc2970b15 100644 --- a/source/common/2d/v_2ddrawer.h +++ b/source/common/2d/v_2ddrawer.h @@ -217,7 +217,7 @@ public: double originx, double originy, double scalex, double scaley, DAngle rotation, const FColormap &colormap, PalEntry flatcolor, double lightlevel, uint32_t *indices, size_t indexcount); void AddPoly(FGameTexture* img, FVector4 *vt, size_t vtcount, const unsigned int *ind, size_t idxcount, int translation, PalEntry color, FRenderStyle style, const IntRect* clip); - void FillPolygon(int* rx1, int* ry1, int* xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2& otex, + void FillPolygon(int* rx1, int* ry1, int* xb1, int32_t npoints, int pic, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2& otex, int clipx1, int clipy1, int clipx2, int clipy2); void AddFlatFill(int left, int top, int right, int bottom, FGameTexture *src, int local_origin = false, double flatscale = 1.0, PalEntry color = 0xffffffff, ERenderStyle rs = STYLE_Normal); diff --git a/source/common/2d/v_draw.cpp b/source/common/2d/v_draw.cpp index 7c1beb0c8..85ed31517 100644 --- a/source/common/2d/v_draw.cpp +++ b/source/common/2d/v_draw.cpp @@ -1786,12 +1786,12 @@ DEFINE_ACTION_FUNCTION(FCanvas, Dim) // //========================================================================== -void DrawBorder (F2DDrawer *drawer, FTextureID picnum, int x1, int y1, int x2, int y2) +void DrawBorder (F2DDrawer *drawer, FTextureID texid, int x1, int y1, int x2, int y2) { int filltype = (ui_screenborder_classic_scaling) ? -1 : 0; - if (picnum.isValid()) + if (texid.isValid()) { - drawer->AddFlatFill (x1, y1, x2, y2, TexMan.GetGameTexture(picnum, false), filltype); + drawer->AddFlatFill (x1, y1, x2, y2, TexMan.GetGameTexture(texid, false), filltype); } else { diff --git a/source/common/fonts/singlepicfont.cpp b/source/common/fonts/singlepicfont.cpp index 687602876..30fdf8711 100644 --- a/source/common/fonts/singlepicfont.cpp +++ b/source/common/fonts/singlepicfont.cpp @@ -65,21 +65,21 @@ protected: FSinglePicFont::FSinglePicFont(const char *picname) : FFont(-1) // Since lump is only needed for priority information we don't need to worry about this here. { - FTextureID picnum = TexMan.CheckForTexture (picname, ETextureType::Any); + FTextureID texid = TexMan.CheckForTexture (picname, ETextureType::Any); - if (!picnum.isValid()) + if (!texid.isValid()) { I_FatalError ("%s is not a font or texture", picname); } - auto pic = TexMan.GetGameTexture(picnum); + auto pic = TexMan.GetGameTexture(texid); FontName = picname; FontHeight = (int)pic->GetDisplayHeight(); SpaceWidth = (int)pic->GetDisplayWidth(); GlobalKerning = 0; FirstChar = LastChar = 'A'; - PicNum = picnum; + PicNum = texid; } //========================================================================== diff --git a/source/common/fonts/v_font.cpp b/source/common/fonts/v_font.cpp index f51813aeb..cb206a4ec 100644 --- a/source/common/fonts/v_font.cpp +++ b/source/common/fonts/v_font.cpp @@ -138,10 +138,10 @@ FFont *V_GetFont(const char *name, const char *fontlumpname) return font; } } - FTextureID picnum = TexMan.CheckForTexture (name, ETextureType::Any); - if (picnum.isValid()) + FTextureID texid = TexMan.CheckForTexture (name, ETextureType::Any); + if (texid.isValid()) { - auto tex = TexMan.GetGameTexture(picnum); + auto tex = TexMan.GetGameTexture(texid); if (tex && tex->GetSourceLump() >= folderfile) { FFont *CreateSinglePicFont(const char *name); diff --git a/source/common/textures/texturemanager.cpp b/source/common/textures/texturemanager.cpp index 94aa40de1..988498408 100644 --- a/source/common/textures/texturemanager.cpp +++ b/source/common/textures/texturemanager.cpp @@ -498,9 +498,9 @@ FTextureID FTextureManager::CreateTexture (int lumpnum, ETextureType usetype) // //========================================================================== -void FTextureManager::ReplaceTexture (FTextureID picnum, FGameTexture *newtexture, bool free) +void FTextureManager::ReplaceTexture (FTextureID texid, FGameTexture *newtexture, bool free) { - int index = picnum.GetIndex(); + int index = texid.GetIndex(); if (unsigned(index) >= Textures.Size()) return; diff --git a/source/common/textures/texturemanager.h b/source/common/textures/texturemanager.h index 575e838ea..3f80514f3 100644 --- a/source/common/textures/texturemanager.h +++ b/source/common/textures/texturemanager.h @@ -137,7 +137,7 @@ public: void AddTextures(void (*progressFunc_)(), void (*checkForHacks)(BuildInfo&), void (*customtexturehandler)() = nullptr); void DeleteAll(); - void ReplaceTexture (FTextureID picnum, FGameTexture *newtexture, bool free); + void ReplaceTexture (FTextureID texid, FGameTexture *newtexture, bool free); int NumTextures () const { return (int)Textures.Size(); } diff --git a/source/common/textures/v_collection.cpp b/source/common/textures/v_collection.cpp index 2b51885bf..975287680 100644 --- a/source/common/textures/v_collection.cpp +++ b/source/common/textures/v_collection.cpp @@ -62,8 +62,8 @@ void FImageCollection::Add (const char **patchNames, int numPatches, ETextureTyp for (int i = 0; i < numPatches; ++i) { - FTextureID picnum = TexMan.CheckForTexture(patchNames[i], namespc); - ImageMap[OldCount + i] = picnum; + FTextureID texid = TexMan.CheckForTexture(patchNames[i], namespc); + ImageMap[OldCount + i] = texid; } }