Merge branch 'master' of git@github.com:coelckers/gzdoom.git

This commit is contained in:
Vitaly Novichkov 2018-03-27 03:17:20 +03:00
commit 7296f8c018
87 changed files with 362 additions and 372 deletions

View File

@ -952,7 +952,7 @@ void AM_StaticInit()
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i); mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i);
marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch); marknums[i] = TexMan.CheckForTexture (namebuf, ETextureType::MiscPatch);
} }
markpointnum = 0; markpointnum = 0;
mapback.SetInvalid(); mapback.SetInvalid();
@ -1356,11 +1356,11 @@ void AM_LevelInit ()
{ {
if (level.info->MapBackground.Len() == 0) if (level.info->MapBackground.Len() == 0)
{ {
mapback = TexMan.CheckForTexture("AUTOPAGE", FTexture::TEX_MiscPatch); mapback = TexMan.CheckForTexture("AUTOPAGE", ETextureType::MiscPatch);
} }
else else
{ {
mapback = TexMan.CheckForTexture(level.info->MapBackground, FTexture::TEX_MiscPatch); mapback = TexMan.CheckForTexture(level.info->MapBackground, ETextureType::MiscPatch);
} }
AM_clearMarks(); AM_clearMarks();
@ -2195,7 +2195,7 @@ void AM_drawSubsectors()
// Draw the polygon. // Draw the polygon.
FTexture *pic = TexMan(maptex); FTexture *pic = TexMan(maptex);
if (pic != NULL && pic->UseType != FTexture::TEX_Null) if (pic != NULL && pic->UseType != ETextureType::Null)
{ {
screen->FillSimplePoly(TexMan(maptex), screen->FillSimplePoly(TexMan(maptex),
&points[0], points.Size(), &points[0], points.Size(),
@ -3069,7 +3069,7 @@ void AM_drawThings ()
static void DrawMarker (FTexture *tex, double x, double y, int yadjust, static void DrawMarker (FTexture *tex, double x, double y, int yadjust,
INTBOOL flip, double xscale, double yscale, int translation, double alpha, uint32_t fillcolor, FRenderStyle renderstyle) INTBOOL flip, double xscale, double yscale, int translation, double alpha, uint32_t fillcolor, FRenderStyle renderstyle)
{ {
if (tex == NULL || tex->UseType == FTexture::TEX_Null) if (tex == NULL || tex->UseType == ETextureType::Null)
{ {
return; return;
} }

View File

@ -1060,7 +1060,7 @@ CCMD(changesky)
sky1name = argv[1]; sky1name = argv[1];
if (sky1name[0] != 0) if (sky1name[0] != 0)
{ {
FTextureID newsky = TexMan.GetTexture(sky1name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); FTextureID newsky = TexMan.GetTexture(sky1name, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
if (newsky.Exists()) if (newsky.Exists())
{ {
sky1texture = level.skytexture1 = newsky; sky1texture = level.skytexture1 = newsky;

View File

@ -586,11 +586,11 @@ void DequeueConsoleText ()
void C_InitConback() void C_InitConback()
{ {
conback = TexMan.CheckForTexture ("CONBACK", FTexture::TEX_MiscPatch); conback = TexMan.CheckForTexture ("CONBACK", ETextureType::MiscPatch);
if (!conback.isValid()) if (!conback.isValid())
{ {
conback = TexMan.GetTexture (gameinfo.TitlePage, FTexture::TEX_MiscPatch); conback = TexMan.GetTexture (gameinfo.TitlePage, ETextureType::MiscPatch);
conshade = MAKEARGB(175,0,0,0); conshade = MAKEARGB(175,0,0,0);
conline = true; conline = true;
} }

View File

@ -243,7 +243,7 @@ void DWaitingCommand::Tick ()
{ {
if (--TicsLeft == 0) if (--TicsLeft == 0)
{ {
UnsafeExecutionScope scope; UnsafeExecutionScope scope(IsUnsafe);
AddCommandString (Command); AddCommandString (Command);
Destroy (); Destroy ();
} }

View File

@ -641,7 +641,7 @@ void SetCompatibilityParams()
if (side != NULL) if (side != NULL)
{ {
assert(TexNames.Size() > (unsigned int)CompatParams[i + 4]); assert(TexNames.Size() > (unsigned int)CompatParams[i + 4]);
const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 4]], FTexture::TEX_Any); const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 4]], ETextureType::Any);
side->SetTexture(CompatParams[i + 3], texID); side->SetTexture(CompatParams[i + 3], texID);
} }
} }
@ -713,7 +713,7 @@ void SetCompatibilityParams()
? sec->floorplane ? sec->floorplane
: sec->ceilingplane; : sec->ceilingplane;
assert(TexNames.Size() > (unsigned int)CompatParams[i + 3]); assert(TexNames.Size() > (unsigned int)CompatParams[i + 3]);
const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 3]], FTexture::TEX_Any); const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 3]], ETextureType::Any);
sec->SetTexture(CompatParams[i + 2], texID); sec->SetTexture(CompatParams[i + 2], texID);
} }

View File

@ -918,7 +918,7 @@ void D_Display ()
// [RH] Draw icon, if any // [RH] Draw icon, if any
if (D_DrawIcon) if (D_DrawIcon)
{ {
FTextureID picnum = TexMan.CheckForTexture (D_DrawIcon, FTexture::TEX_MiscPatch); FTextureID picnum = TexMan.CheckForTexture (D_DrawIcon, ETextureType::MiscPatch);
D_DrawIcon = NULL; D_DrawIcon = NULL;
if (picnum.isValid()) if (picnum.isValid())

View File

@ -487,10 +487,10 @@ void FDecalLib::ParseDecal (FScanner &sc)
case DECAL_PIC: case DECAL_PIC:
sc.MustGetString (); sc.MustGetString ();
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Any); picnum = TexMan.CheckForTexture (sc.String, ETextureType::Any);
if (!picnum.Exists() && (lumpnum = Wads.CheckNumForName (sc.String, ns_graphics)) >= 0) if (!picnum.Exists() && (lumpnum = Wads.CheckNumForName (sc.String, ns_graphics)) >= 0)
{ {
picnum = TexMan.CreateTexture (lumpnum, FTexture::TEX_Decal); picnum = TexMan.CreateTexture (lumpnum, ETextureType::Decal);
} }
newdecal.PicNum = picnum; newdecal.PicNum = picnum;
break; break;

View File

@ -179,6 +179,25 @@ inline int Luminance(int r, int g, int b)
} }
enum class ETextureType : uint8_t
{
Any,
Wall,
Flat,
Sprite,
WallPatch,
Build, // no longer used but needs to remain for ZScript
SkinSprite,
Decal,
MiscPatch,
FontChar,
Override, // For patches between TX_START/TX_END
Autopage, // Automap background - used to enable the use of FAutomapTexture
SkinGraphic,
Null,
FirstDefined,
};
class FTextureID class FTextureID
{ {
friend class FTextureManager; friend class FTextureManager;

View File

@ -1890,7 +1890,7 @@ void FParser::SF_FloorTexture(void)
if(t_argc > 1) if(t_argc > 1)
{ {
int i = -1; int i = -1;
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTexture(t_argv[1].string, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
// set all sectors with tag // set all sectors with tag
FSSectorTagIterator itr(tagnum); FSSectorTagIterator itr(tagnum);
@ -1980,7 +1980,7 @@ void FParser::SF_CeilingTexture(void)
if(t_argc > 1) if(t_argc > 1)
{ {
int i = -1; int i = -1;
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTexture(t_argv[1].string, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
// set all sectors with tag // set all sectors with tag
FSSectorTagIterator itr(tagnum); FSSectorTagIterator itr(tagnum);
@ -2233,7 +2233,7 @@ void FParser::SF_SetLineTexture(void)
position=3-position; position=3-position;
texture = stringvalue(t_argv[3]); texture = stringvalue(t_argv[3]);
texturenum = TexMan.GetTexture(texture, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); texturenum = TexMan.GetTexture(texture, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
FLineIdIterator itr(tag); FLineIdIterator itr(tag);
while ((i = itr.Next()) >= 0) while ((i = itr.Next()) >= 0)
@ -2250,7 +2250,7 @@ void FParser::SF_SetLineTexture(void)
} }
else // and an improved legacy version else // and an improved legacy version
{ {
FTextureID picnum = TexMan.GetTexture(t_argv[1].string, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTexture(t_argv[1].string, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
side = !!intvalue(t_argv[2]); side = !!intvalue(t_argv[2]);
int sections = intvalue(t_argv[3]); int sections = intvalue(t_argv[3]);

View File

@ -192,7 +192,7 @@ void FScriptLoader::ParseInfoCmd(char *line, FString &scriptsrc)
sc.MustGetStringName("="); sc.MustGetStringName("=");
sc.MustGetString(); sc.MustGetString();
sky2texture = sky1texture = level.skytexture1 = level.skytexture2 = TexMan.GetTexture (sc.String, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst); sky2texture = sky1texture = level.skytexture1 = level.skytexture2 = TexMan.GetTexture (sc.String, ETextureType::Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
R_InitSkyMap (); R_InitSkyMap ();
} }
else if (sc.Compare("interpic")) else if (sc.Compare("interpic"))

View File

@ -743,7 +743,7 @@ void G_DoCompleted (void)
AM_Stop (); AM_Stop ();
wminfo.finished_ep = level.cluster - 1; wminfo.finished_ep = level.cluster - 1;
wminfo.LName0 = TexMan.CheckForTexture(level.info->PName, FTexture::TEX_MiscPatch); wminfo.LName0 = TexMan.CheckForTexture(level.info->PName, ETextureType::MiscPatch);
wminfo.current = level.MapName; wminfo.current = level.MapName;
if (deathmatch && if (deathmatch &&
@ -764,7 +764,7 @@ void G_DoCompleted (void)
else else
{ {
wminfo.next = nextinfo->MapName; wminfo.next = nextinfo->MapName;
wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, FTexture::TEX_MiscPatch); wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, ETextureType::MiscPatch);
} }
} }
@ -955,7 +955,7 @@ void G_DoLoadLevel (int position, bool autosave)
// a flat. The data is in the WAD only because // a flat. The data is in the WAD only because
// we look for an actual index, instead of simply // we look for an actual index, instead of simply
// setting one. // setting one.
skyflatnum = TexMan.GetTexture (gameinfo.SkyFlatName, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); skyflatnum = TexMan.GetTexture (gameinfo.SkyFlatName, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
// DOOM determines the sky texture to be used // DOOM determines the sky texture to be used
// depending on the current episode and the game version. // depending on the current episode and the game version.
@ -1427,8 +1427,8 @@ void G_InitLevelLocals ()
level.info = info; level.info = info;
level.skyspeed1 = info->skyspeed1; level.skyspeed1 = info->skyspeed1;
level.skyspeed2 = info->skyspeed2; level.skyspeed2 = info->skyspeed2;
level.skytexture1 = TexMan.GetTexture(info->SkyPic1, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); level.skytexture1 = TexMan.GetTexture(info->SkyPic1, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
level.skytexture2 = TexMan.GetTexture(info->SkyPic2, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); level.skytexture2 = TexMan.GetTexture(info->SkyPic2, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
level.fadeto = info->fadeto; level.fadeto = info->fadeto;
level.cdtrack = info->cdtrack; level.cdtrack = info->cdtrack;
level.cdid = info->cdid; level.cdid = info->cdid;

View File

@ -354,7 +354,7 @@ static void DrawArmor(AInventory * barmor, AInventory * harmor, int x, int y)
case 3: icon[3] = '4'; break; case 3: icon[3] = '4'; break;
default: break; default: break;
} }
DrawImageToBox(TexMan.FindTexture(icon, FTexture::TEX_Sprite), x, y, 31, 17); DrawImageToBox(TexMan.FindTexture(icon, ETextureType::Sprite), x, y, 31, 17);
} }
else if (barmor) DrawImageToBox(TexMan[barmor->Icon], x, y, 31, 17); else if (barmor) DrawImageToBox(TexMan[barmor->Icon], x, y, 31, 17);
DrawHudNumber(HudFont, fontcolor, ap, x + 33, y + 17); DrawHudNumber(HudFont, fontcolor, ap, x + 33, y + 17);
@ -1285,13 +1285,13 @@ void HUD_InitHud()
if (sc.Compare("Health")) if (sc.Compare("Health"))
{ {
sc.MustGetString(); sc.MustGetString();
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch); FTextureID tex = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
if (tex.isValid()) healthpic = TexMan[tex]; if (tex.isValid()) healthpic = TexMan[tex];
} }
else if (sc.Compare("Berserk")) else if (sc.Compare("Berserk"))
{ {
sc.MustGetString(); sc.MustGetString();
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch); FTextureID tex = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
if (tex.isValid()) berserkpic = TexMan[tex]; if (tex.isValid()) berserkpic = TexMan[tex];
} }
else else
@ -1311,7 +1311,7 @@ void HUD_InitHud()
if (!sc.Compare("0") && !sc.Compare("NULL") && !sc.Compare("")) if (!sc.Compare("0") && !sc.Compare("NULL") && !sc.Compare(""))
{ {
tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch); tex = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
} }
else tex.SetInvalid(); else tex.SetInvalid();

View File

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

View File

@ -300,7 +300,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
if (flags & DI_ALTERNATEONFAIL) if (flags & DI_ALTERNATEONFAIL)
{ {
SetTruth(texture == NULL || texture->UseType == FTexture::TEX_Null, block, statusBar); SetTruth(texture == NULL || texture->UseType == ETextureType::Null, block, statusBar);
} }
} }
protected: protected:

View File

@ -214,14 +214,14 @@ void ST_LoadCrosshair(bool alwaysload)
size = (SCREENWIDTH < 640) ? 'S' : 'B'; size = (SCREENWIDTH < 640) ? 'S' : 'B';
mysnprintf (name, countof(name), "XHAIR%c%d", size, num); mysnprintf (name, countof(name), "XHAIR%c%d", size, num);
FTextureID texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); FTextureID texid = TexMan.CheckForTexture(name, ETextureType::MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
if (!texid.isValid()) if (!texid.isValid())
{ {
mysnprintf (name, countof(name), "XHAIR%c1", size); mysnprintf (name, countof(name), "XHAIR%c1", size);
texid = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); texid = TexMan.CheckForTexture(name, ETextureType::MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
if (!texid.isValid()) if (!texid.isValid())
{ {
texid = TexMan.CheckForTexture("XHAIRS1", FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly); texid = TexMan.CheckForTexture("XHAIRS1", ETextureType::MiscPatch, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ShortNameOnly);
} }
} }
CrosshairNum = num; CrosshairNum = num;
@ -1670,7 +1670,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawImage)
PARAM_FLOAT_DEF(scaleX); PARAM_FLOAT_DEF(scaleX);
PARAM_FLOAT_DEF(scaleY); PARAM_FLOAT_DEF(scaleY);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(TexMan.CheckForTexture(texid, FTexture::TEX_Any), x, y, flags, alpha, w, h, scaleX, scaleY); self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY);
return 0; return 0;
} }

View File

@ -92,7 +92,7 @@ void AdjustSpriteOffsets()
char str[9]; char str[9];
Wads.GetLumpName(str, i); Wads.GetLumpName(str, i);
str[8] = 0; str[8] = 0;
FTextureID texid = TexMan.CheckForTexture(str, FTexture::TEX_Sprite, 0); FTextureID texid = TexMan.CheckForTexture(str, ETextureType::Sprite, 0);
if (texid.isValid() && Wads.GetLumpFile(TexMan[texid]->SourceLump) > Wads.GetIwadNum()) if (texid.isValid() && Wads.GetLumpFile(TexMan[texid]->SourceLump) > Wads.GetIwadNum())
{ {
// This texture has been replaced by some PWAD. // This texture has been replaced by some PWAD.
@ -114,7 +114,7 @@ void AdjustSpriteOffsets()
int x,y; int x,y;
bool iwadonly = false; bool iwadonly = false;
bool forced = false; bool forced = false;
FTextureID texno = TexMan.CheckForTexture(sc.String, FTexture::TEX_Sprite); FTextureID texno = TexMan.CheckForTexture(sc.String, ETextureType::Sprite);
sc.MustGetStringName(","); sc.MustGetStringName(",");
sc.MustGetNumber(); sc.MustGetNumber();
x=sc.Number; x=sc.Number;

View File

@ -50,7 +50,7 @@ void gl_InitGlow(FScanner &sc)
while (!sc.CheckString("}")) while (!sc.CheckString("}"))
{ {
sc.MustGetString(); sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, FTexture::TEX_Flat,FTextureManager::TEXMAN_TryAny); FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Flat,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump]; FTexture *tex = TexMan[flump];
if (tex) tex->gl_info.bAutoGlowing = tex->gl_info.bGlowing = tex->gl_info.bFullbright = true; if (tex) tex->gl_info.bAutoGlowing = tex->gl_info.bGlowing = tex->gl_info.bFullbright = true;
} }
@ -61,7 +61,7 @@ void gl_InitGlow(FScanner &sc)
while (!sc.CheckString("}")) while (!sc.CheckString("}"))
{ {
sc.MustGetString(); sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, FTexture::TEX_Wall,FTextureManager::TEXMAN_TryAny); FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Wall,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump]; FTexture *tex = TexMan[flump];
if (tex) tex->gl_info.bAutoGlowing = tex->gl_info.bGlowing = tex->gl_info.bFullbright = true; if (tex) tex->gl_info.bAutoGlowing = tex->gl_info.bGlowing = tex->gl_info.bFullbright = true;
} }
@ -70,7 +70,7 @@ void gl_InitGlow(FScanner &sc)
{ {
sc.SetCMode(true); sc.SetCMode(true);
sc.MustGetString(); sc.MustGetString();
FTextureID flump=TexMan.CheckForTexture(sc.String, FTexture::TEX_Flat,FTextureManager::TEXMAN_TryAny); FTextureID flump=TexMan.CheckForTexture(sc.String, ETextureType::Flat,FTextureManager::TEXMAN_TryAny);
FTexture *tex = TexMan[flump]; FTexture *tex = TexMan[flump];
sc.MustGetStringName(","); sc.MustGetStringName(",");
sc.MustGetString(); sc.MustGetString();

View File

@ -236,10 +236,10 @@ FGLRenderer::~FGLRenderer()
void FGLRenderer::GetSpecialTextures() void FGLRenderer::GetSpecialTextures()
{ {
if (gl.legacyMode) glLight = TexMan.CheckForTexture("glstuff/gllight.png", FTexture::TEX_MiscPatch); if (gl.legacyMode) glLight = TexMan.CheckForTexture("glstuff/gllight.png", ETextureType::MiscPatch);
glPart2 = TexMan.CheckForTexture("glstuff/glpart2.png", FTexture::TEX_MiscPatch); glPart2 = TexMan.CheckForTexture("glstuff/glpart2.png", ETextureType::MiscPatch);
glPart = TexMan.CheckForTexture("glstuff/glpart.png", FTexture::TEX_MiscPatch); glPart = TexMan.CheckForTexture("glstuff/glpart.png", ETextureType::MiscPatch);
mirrorTexture = TexMan.CheckForTexture("glstuff/mirror.png", FTexture::TEX_MiscPatch); mirrorTexture = TexMan.CheckForTexture("glstuff/mirror.png", ETextureType::MiscPatch);
} }

View File

@ -135,7 +135,7 @@ void GLSceneDrawer::AddLine (seg_t *seg, bool portalclip)
if (!seg->linedef->isVisualPortal()) if (!seg->linedef->isVisualPortal())
{ {
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==ETextureType::Null)
{ {
// nothing to do here! // nothing to do here!
seg->linedef->validcount=validcount; seg->linedef->validcount=validcount;

View File

@ -114,7 +114,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
if (bs_ceilingheight1 <= fs_floorheight1 && bs_ceilingheight2 <= fs_floorheight2) if (bs_ceilingheight1 <= fs_floorheight1 && bs_ceilingheight2 <= fs_floorheight2)
{ {
FTexture * tex = TexMan(sidedef->GetTexture(side_t::top)); FTexture * tex = TexMan(sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType == FTexture::TEX_Null) return false; if (!tex || tex->UseType == ETextureType::Null) return false;
if (backsector->GetTexture(sector_t::ceiling) == skyflatnum && if (backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false; frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false;
return true; return true;
@ -123,7 +123,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
if (fs_ceilingheight1 <= bs_floorheight1 && fs_ceilingheight2 <= bs_floorheight2) if (fs_ceilingheight1 <= bs_floorheight1 && fs_ceilingheight2 <= bs_floorheight2)
{ {
FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom)); FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType == FTexture::TEX_Null) return false; if (!tex || tex->UseType == ETextureType::Null) return false;
// properly render skies (consider door "open" if both floors are sky): // properly render skies (consider door "open" if both floors are sky):
if (backsector->GetTexture(sector_t::ceiling) == skyflatnum && if (backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
@ -137,12 +137,12 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
if (bs_ceilingheight1 < fs_ceilingheight1 || bs_ceilingheight2 < fs_ceilingheight2) if (bs_ceilingheight1 < fs_ceilingheight1 || bs_ceilingheight2 < fs_ceilingheight2)
{ {
FTexture * tex = TexMan(sidedef->GetTexture(side_t::top)); FTexture * tex = TexMan(sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType == FTexture::TEX_Null) return false; if (!tex || tex->UseType == ETextureType::Null) return false;
} }
if (bs_floorheight1 > fs_floorheight1 || bs_floorheight2 > fs_floorheight2) if (bs_floorheight1 > fs_floorheight1 || bs_floorheight2 > fs_floorheight2)
{ {
FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom)); FTexture * tex = TexMan(sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType == FTexture::TEX_Null) return false; if (!tex || tex->UseType == ETextureType::Null) return false;
} }
if (backsector->GetTexture(sector_t::ceiling) == skyflatnum && if (backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false; frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false;

View File

@ -298,7 +298,7 @@ bool FDrawInfo::DoOneSectorUpper(subsector_t * subsec, float Planez)
{ {
// If there's a texture abort // If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::top)]; FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::top)];
if (!tex || tex->UseType == FTexture::TEX_Null) continue; if (!tex || tex->UseType == ETextureType::Null) continue;
else return false; else return false;
} }
} }
@ -356,7 +356,7 @@ bool FDrawInfo::DoOneSectorLower(subsector_t * subsec, float Planez)
{ {
// If there's a texture abort // If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::bottom)]; FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::bottom)];
if (!tex || tex->UseType == FTexture::TEX_Null) continue; if (!tex || tex->UseType == ETextureType::Null) continue;
else return false; else return false;
} }
} }

View File

@ -66,7 +66,7 @@ void GLSkyInfo::init(int sky1, PalEntry FadeColor)
FTextureID texno = s->GetTexture(pos); FTextureID texno = s->GetTexture(pos);
texture[0] = FMaterial::ValidateTexture(texno, false, true); texture[0] = FMaterial::ValidateTexture(texno, false, true);
if (!texture[0] || texture[0]->tex->UseType == FTexture::TEX_Null) goto normalsky; if (!texture[0] || texture[0]->tex->UseType == ETextureType::Null) goto normalsky;
skytexno1 = texno; skytexno1 = texno;
x_offset[0] = s->GetTextureXOffset(pos) * (360.f/65536.f); x_offset[0] = s->GetTextureXOffset(pos) * (360.f/65536.f);
y_offset = s->GetTextureYOffset(pos); y_offset = s->GetTextureYOffset(pos);
@ -247,7 +247,7 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex
if (bs->GetPlaneTexZ(sector_t::floor)==fs->GetPlaneTexZ(sector_t::floor)+1.) if (bs->GetPlaneTexZ(sector_t::floor)==fs->GetPlaneTexZ(sector_t::floor)+1.)
{ {
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom)); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) return; if (!tex || tex->UseType==ETextureType::Null) return;
// very, very, very ugly special case (See Icarus MAP14) // 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 // It is VERY important that this is only done for a floor height difference of 1
@ -331,7 +331,7 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom)); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
// For lower skies the normal logic only applies to walls with no lower texture! // For lower skies the normal logic only applies to walls with no lower texture!
if (tex->UseType==FTexture::TEX_Null) if (tex->UseType==ETextureType::Null)
{ {
if (bs->GetTexture(sector_t::floor)==skyflatnum) if (bs->GetTexture(sector_t::floor)==skyflatnum)
{ {
@ -349,7 +349,7 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver
} }
zbottom[0]=zbottom[1]=-32768.0f; zbottom[0]=zbottom[1]=-32768.0f;
if ((tex && tex->UseType!=FTexture::TEX_Null) || bs->GetTexture(sector_t::floor)!=skyflatnum) if ((tex && tex->UseType!=ETextureType::Null) || bs->GetTexture(sector_t::floor)!=skyflatnum)
{ {
ztop[0]=zfloor[0]; ztop[0]=zfloor[0];
ztop[1]=zfloor[1]; ztop[1]=zfloor[1];

View File

@ -819,7 +819,10 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
// [ZZ] add direct picnum override // [ZZ] add direct picnum override
if (isPicnumOverride) if (isPicnumOverride)
{ {
patch = thing->picnum; // Animate picnum overrides.
auto tex = TexMan(thing->picnum);
if (tex == nullptr) return;
patch = tex->id;
mirror = false; mirror = false;
} }
else else

View File

@ -822,7 +822,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// //
// //
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top)); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==ETextureType::Null)
{ {
if (front->GetTexture(sector_t::ceiling) == skyflatnum && if (front->GetTexture(sector_t::ceiling) == skyflatnum &&
back->GetTexture(sector_t::ceiling) == skyflatnum) back->GetTexture(sector_t::ceiling) == skyflatnum)
@ -858,7 +858,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// //
// //
tex = TexMan(seg->sidedef->GetTexture(side_t::bottom)); tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==ETextureType::Null)
{ {
// texture is missing - use the lower plane // texture is missing - use the lower plane
bottomleft = MIN(bfh1,ffh1); bottomleft = MIN(bfh1,ffh1);
@ -1392,12 +1392,6 @@ void GLWall::DoFFloorBlocks(seg_t * seg, sector_t * frontsector, sector_t * back
ff_topleft = topleft; ff_topleft = topleft;
ff_topright = topright; ff_topright = topright;
} }
if (ff_bottomleft < bottomleft && ff_bottomright < bottomright)
{
// the new section extends into the floor.
ff_bottomleft = bottomleft;
ff_bottomright = bottomright;
}
// do all inverse floors above the current one it there is a gap between the // do all inverse floors above the current one it there is a gap between the
// last 3D floor and this one. // last 3D floor and this one.

View File

@ -223,8 +223,8 @@ void PostProcessShaderInstance::BindTextures()
continue; continue;
FString name = pair->Value; FString name = pair->Value;
FTexture *tex = TexMan(TexMan.CheckForTexture(name, FTexture::TEX_Any)); FTexture *tex = TexMan(TexMan.CheckForTexture(name, ETextureType::Any));
if (tex && tex->UseType != FTexture::TEX_Null) if (tex && tex->UseType != ETextureType::Null)
{ {
glUniform1i(location, textureUnit); glUniform1i(location, textureUnit);

View File

@ -964,11 +964,11 @@ void gl_ParseHardwareShader(FScanner &sc, int deflump)
} }
else else
{ {
int type = FTexture::TEX_Any; ETextureType type = ETextureType::Any;
if (sc.Compare("texture")) type = FTexture::TEX_Wall; if (sc.Compare("texture")) type = ETextureType::Wall;
else if (sc.Compare("flat")) type = FTexture::TEX_Flat; else if (sc.Compare("flat")) type = ETextureType::Flat;
else if (sc.Compare("sprite")) type = FTexture::TEX_Sprite; else if (sc.Compare("sprite")) type = ETextureType::Sprite;
else sc.UnGet(); else sc.UnGet();
bool disable_fullbright = false; bool disable_fullbright = false;

View File

@ -243,7 +243,7 @@ bool FShaderLayer::ParseLayer(FScanner &sc)
if (sc.GetString()) if (sc.GetString())
{ {
texture = TexMan.CheckForTexture(sc.String, FTexture::TEX_Wall); texture = TexMan.CheckForTexture(sc.String, ETextureType::Wall);
if (!texture.isValid()) if (!texture.isValid())
{ {
sc.ScriptMessage("Unknown texture '%s'", sc.String); sc.ScriptMessage("Unknown texture '%s'", sc.String);

View File

@ -111,14 +111,14 @@ int CheckDDPK3(FTexture *tex)
FString checkName; FString checkName;
const char ** checklist; const char ** checklist;
uint8_t useType=tex->UseType; ETextureType useType=tex->UseType;
if (useType==FTexture::TEX_SkinSprite || useType==FTexture::TEX_Decal || useType==FTexture::TEX_FontChar) if (useType==ETextureType::SkinSprite || useType==ETextureType::Decal || useType==ETextureType::FontChar)
{ {
return -3; return -3;
} }
bool ispatch = (useType==FTexture::TEX_MiscPatch || useType==FTexture::TEX_Sprite) ; bool ispatch = (useType==ETextureType::MiscPatch || useType==ETextureType::Sprite) ;
// for patches this doesn't work yet // for patches this doesn't work yet
if (ispatch) return -3; if (ispatch) return -3;
@ -127,34 +127,34 @@ int CheckDDPK3(FTexture *tex)
{ {
if (!(gameinfo.flags & GI_MAPxx)) if (!(gameinfo.flags & GI_MAPxx))
{ {
checklist = useType==FTexture::TEX_Flat? doomflatpath : doom1texpath; checklist = useType==ETextureType::Flat? doomflatpath : doom1texpath;
} }
else else
{ {
SetDoom2Wad(); SetDoom2Wad();
if (Doom2Wad == 1) if (Doom2Wad == 1)
checklist = useType==FTexture::TEX_Flat? doomflatpath : pluttexpath; checklist = useType==ETextureType::Flat? doomflatpath : pluttexpath;
else if (Doom2Wad == 2) else if (Doom2Wad == 2)
checklist = useType==FTexture::TEX_Flat? doomflatpath : tnttexpath; checklist = useType==ETextureType::Flat? doomflatpath : tnttexpath;
else else
checklist = useType==FTexture::TEX_Flat? doomflatpath : doom2texpath; checklist = useType==ETextureType::Flat? doomflatpath : doom2texpath;
} }
} }
else if (!gameinfo.ConfigName.CompareNoCase("Heretic")) else if (!gameinfo.ConfigName.CompareNoCase("Heretic"))
{ {
checklist = useType==FTexture::TEX_Flat? hereticflatpath : heretictexpath; checklist = useType==ETextureType::Flat? hereticflatpath : heretictexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Hexen")) else if (!gameinfo.ConfigName.CompareNoCase("Hexen"))
{ {
checklist = useType==FTexture::TEX_Flat? hexenflatpath : hexentexpath; checklist = useType==ETextureType::Flat? hexenflatpath : hexentexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Strife")) else if (!gameinfo.ConfigName.CompareNoCase("Strife"))
{ {
checklist = useType==FTexture::TEX_Flat? strifeflatpath : strifetexpath; checklist = useType==ETextureType::Flat? strifeflatpath : strifetexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Chex")) else if (!gameinfo.ConfigName.CompareNoCase("Chex"))
{ {
checklist = useType==FTexture::TEX_Flat? chexflatpath : chextexpath; checklist = useType==ETextureType::Flat? chexflatpath : chextexpath;
} }
else else
return -3; return -3;
@ -292,14 +292,14 @@ int CheckExternalFile(FTexture *tex, bool & hascolorkey)
FString checkName; FString checkName;
const char ** checklist; const char ** checklist;
uint8_t useType=tex->UseType; ETextureType useType = tex->UseType;
if (useType==FTexture::TEX_SkinSprite || useType==FTexture::TEX_Decal || useType==FTexture::TEX_FontChar) if (useType == ETextureType::SkinSprite || useType == ETextureType::Decal || useType == ETextureType::FontChar)
{ {
return -3; return -3;
} }
bool ispatch = (useType==FTexture::TEX_MiscPatch || useType==FTexture::TEX_Sprite) ; bool ispatch = (useType==ETextureType::MiscPatch || useType==ETextureType::Sprite) ;
// for patches this doesn't work yet // for patches this doesn't work yet
if (ispatch) return -3; if (ispatch) return -3;
@ -308,34 +308,34 @@ int CheckExternalFile(FTexture *tex, bool & hascolorkey)
{ {
if (!(gameinfo.flags & GI_MAPxx)) if (!(gameinfo.flags & GI_MAPxx))
{ {
checklist = ispatch ? doom1patchpath : useType==FTexture::TEX_Flat? doom1flatpath : doom1texpath; checklist = ispatch ? doom1patchpath : useType==ETextureType::Flat? doom1flatpath : doom1texpath;
} }
else else
{ {
SetDoom2Wad(); SetDoom2Wad();
if (Doom2Wad == 1) if (Doom2Wad == 1)
checklist = ispatch ? plutpatchpath : useType==FTexture::TEX_Flat? plutflatpath : pluttexpath; checklist = ispatch ? plutpatchpath : useType==ETextureType::Flat? plutflatpath : pluttexpath;
else if (Doom2Wad == 2) else if (Doom2Wad == 2)
checklist = ispatch ? tntpatchpath : useType==FTexture::TEX_Flat? tntflatpath : tnttexpath; checklist = ispatch ? tntpatchpath : useType==ETextureType::Flat? tntflatpath : tnttexpath;
else else
checklist = ispatch ? doom2patchpath : useType==FTexture::TEX_Flat? doom2flatpath : doom2texpath; checklist = ispatch ? doom2patchpath : useType==ETextureType::Flat? doom2flatpath : doom2texpath;
} }
} }
else if (!gameinfo.ConfigName.CompareNoCase("Heretic")) else if (!gameinfo.ConfigName.CompareNoCase("Heretic"))
{ {
checklist = ispatch ? hereticpatchpath : useType==FTexture::TEX_Flat? hereticflatpath : heretictexpath; checklist = ispatch ? hereticpatchpath : useType==ETextureType::Flat? hereticflatpath : heretictexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Hexen")) else if (!gameinfo.ConfigName.CompareNoCase("Hexen"))
{ {
checklist = ispatch ? hexenpatchpath : useType==FTexture::TEX_Flat? hexenflatpath : hexentexpath; checklist = ispatch ? hexenpatchpath : useType==ETextureType::Flat? hexenflatpath : hexentexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Strife")) else if (!gameinfo.ConfigName.CompareNoCase("Strife"))
{ {
checklist = ispatch ?strifepatchpath : useType==FTexture::TEX_Flat? strifeflatpath : strifetexpath; checklist = ispatch ?strifepatchpath : useType==ETextureType::Flat? strifeflatpath : strifetexpath;
} }
else if (!gameinfo.ConfigName.CompareNoCase("Chex")) else if (!gameinfo.ConfigName.CompareNoCase("Chex"))
{ {
checklist = ispatch ?chexpatchpath : useType==FTexture::TEX_Flat? chexflatpath : chextexpath; checklist = ispatch ?chexpatchpath : useType==ETextureType::Flat? chexflatpath : chextexpath;
} }
else else
return -3; return -3;

View File

@ -339,12 +339,12 @@ unsigned char *gl_CreateUpsampledTextureBuffer ( const FTexture *inputTexture, u
switch (inputTexture->UseType) switch (inputTexture->UseType)
{ {
case FTexture::TEX_Sprite: case ETextureType::Sprite:
case FTexture::TEX_SkinSprite: case ETextureType::SkinSprite:
if (!(gl_texture_hqresize_targets & 2)) return inputBuffer; if (!(gl_texture_hqresize_targets & 2)) return inputBuffer;
break; break;
case FTexture::TEX_FontChar: case ETextureType::FontChar:
if (!(gl_texture_hqresize_targets & 4)) return inputBuffer; if (!(gl_texture_hqresize_targets & 4)) return inputBuffer;
break; break;

View File

@ -110,7 +110,7 @@ unsigned char *FGLTexture::LoadHiresTexture(FTexture *tex, int *width, int *heig
if (HiresLump >=0) if (HiresLump >=0)
{ {
hirestexture = FTexture::CreateTexture(HiresLump, FTexture::TEX_Any); hirestexture = FTexture::CreateTexture(HiresLump, ETextureType::Any);
} }
} }
if (hirestexture != NULL) if (hirestexture != NULL)
@ -261,7 +261,7 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F
FHardwareTexture *FGLTexture::CreateHwTexture() FHardwareTexture *FGLTexture::CreateHwTexture()
{ {
if (tex->UseType==FTexture::TEX_Null) return NULL; // Cannot register a NULL texture if (tex->UseType==ETextureType::Null) return NULL; // Cannot register a NULL texture
if (mHwTexture == NULL) if (mHwTexture == NULL)
{ {
mHwTexture = new FHardwareTexture(tex->GetWidth() + bExpandFlag*2, tex->GetHeight() + bExpandFlag*2, tex->gl_info.bNoCompress); mHwTexture = new FHardwareTexture(tex->GetWidth() + bExpandFlag*2, tex->GetHeight() + bExpandFlag*2, tex->gl_info.bNoCompress);
@ -418,7 +418,7 @@ float FTexCoordInfo::TextureAdjustWidth() const
//=========================================================================== //===========================================================================
FGLTexture * FMaterial::ValidateSysTexture(FTexture * tex, bool expand) FGLTexture * FMaterial::ValidateSysTexture(FTexture * tex, bool expand)
{ {
if (tex && tex->UseType!=FTexture::TEX_Null) if (tex && tex->UseType!=ETextureType::Null)
{ {
FGLTexture *gltex = tex->gl_info.SystemTexture[expand]; FGLTexture *gltex = tex->gl_info.SystemTexture[expand];
if (gltex == NULL) if (gltex == NULL)
@ -870,7 +870,7 @@ void FMaterial::BindToFrameBuffer()
FMaterial * FMaterial::ValidateTexture(FTexture * tex, bool expand) FMaterial * FMaterial::ValidateTexture(FTexture * tex, bool expand)
{ {
again: again:
if (tex && tex->UseType!=FTexture::TEX_Null) if (tex && tex->UseType!=ETextureType::Null)
{ {
if (tex->gl_info.bNoExpand) expand = false; if (tex->gl_info.bNoExpand) expand = false;

View File

@ -233,7 +233,7 @@ void FTexture::CreateDefaultBrightmap()
{ {
// Check for brightmaps // Check for brightmaps
if (UseBasePalette() && HasGlobalBrightmap && if (UseBasePalette() && HasGlobalBrightmap &&
UseType != TEX_Decal && UseType != TEX_MiscPatch && UseType != TEX_FontChar && UseType != ETextureType::Decal && UseType != ETextureType::MiscPatch && UseType != ETextureType::FontChar &&
gl_info.Brightmap == NULL && bWarped == 0 gl_info.Brightmap == NULL && bWarped == 0
) )
{ {
@ -312,7 +312,7 @@ bool FTexture::FindHoles(const unsigned char * buffer, int w, int h)
// already done! // already done!
if (gl_info.areacount) return false; if (gl_info.areacount) return false;
if (UseType == TEX_Flat) return false; // flats don't have transparent parts if (UseType == ETextureType::Flat) return false; // flats don't have transparent parts
gl_info.areacount=-1; //whatever happens next, it shouldn't be done twice! gl_info.areacount=-1; //whatever happens next, it shouldn't be done twice!
// large textures are excluded for performance reasons // large textures are excluded for performance reasons
@ -544,7 +544,7 @@ int FBrightmapTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotat
void gl_ParseMaterial(FScanner &sc, int deflump) void gl_ParseMaterial(FScanner &sc, int deflump)
{ {
int type = FTexture::TEX_Any; ETextureType type = ETextureType::Any;
bool disable_fullbright = false; bool disable_fullbright = false;
bool disable_fullbright_specified = false; bool disable_fullbright_specified = false;
bool thiswad = false; bool thiswad = false;
@ -556,9 +556,9 @@ void gl_ParseMaterial(FScanner &sc, int deflump)
memset(textures, 0, sizeof(textures)); memset(textures, 0, sizeof(textures));
sc.MustGetString(); sc.MustGetString();
if (sc.Compare("texture")) type = FTexture::TEX_Wall; if (sc.Compare("texture")) type = ETextureType::Wall;
else if (sc.Compare("flat")) type = FTexture::TEX_Flat; else if (sc.Compare("flat")) type = ETextureType::Flat;
else if (sc.Compare("sprite")) type = FTexture::TEX_Sprite; else if (sc.Compare("sprite")) type = ETextureType::Sprite;
else sc.UnGet(); else sc.UnGet();
sc.MustGetString(); sc.MustGetString();
@ -608,7 +608,7 @@ void gl_ParseMaterial(FScanner &sc, int deflump)
sc.MustGetString(); sc.MustGetString();
if (textures[i]) if (textures[i])
Printf("Multiple %s definitions in texture %s\n", keywords[i], tex? tex->Name.GetChars() : "(null)"); Printf("Multiple %s definitions in texture %s\n", keywords[i], tex? tex->Name.GetChars() : "(null)");
textures[i] = TexMan.FindTexture(sc.String, FTexture::TEX_Any, FTextureManager::TEXMAN_TryAny); textures[i] = TexMan.FindTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
if (!textures[i]) if (!textures[i])
Printf("%s '%s' not found in texture '%s'\n", notFound[i], sc.String, tex? tex->Name.GetChars() : "(null)"); Printf("%s '%s' not found in texture '%s'\n", notFound[i], sc.String, tex? tex->Name.GetChars() : "(null)");
break; break;
@ -663,16 +663,16 @@ void gl_ParseMaterial(FScanner &sc, int deflump)
void gl_ParseBrightmap(FScanner &sc, int deflump) void gl_ParseBrightmap(FScanner &sc, int deflump)
{ {
int type = FTexture::TEX_Any; ETextureType type = ETextureType::Any;
bool disable_fullbright=false; bool disable_fullbright=false;
bool thiswad = false; bool thiswad = false;
bool iwad = false; bool iwad = false;
FTexture *bmtex = NULL; FTexture *bmtex = NULL;
sc.MustGetString(); sc.MustGetString();
if (sc.Compare("texture")) type = FTexture::TEX_Wall; if (sc.Compare("texture")) type = ETextureType::Wall;
else if (sc.Compare("flat")) type = FTexture::TEX_Flat; else if (sc.Compare("flat")) type = ETextureType::Flat;
else if (sc.Compare("sprite")) type = FTexture::TEX_Sprite; else if (sc.Compare("sprite")) type = ETextureType::Sprite;
else sc.UnGet(); else sc.UnGet();
sc.MustGetString(); sc.MustGetString();
@ -709,7 +709,7 @@ void gl_ParseBrightmap(FScanner &sc, int deflump)
Printf("Multiple brightmap definitions in texture %s\n", tex? tex->Name.GetChars() : "(null)"); Printf("Multiple brightmap definitions in texture %s\n", tex? tex->Name.GetChars() : "(null)");
} }
bmtex = TexMan.FindTexture(sc.String, FTexture::TEX_Any, FTextureManager::TEXMAN_TryAny); bmtex = TexMan.FindTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
if (bmtex == NULL) if (bmtex == NULL)
Printf("Brightmap '%s' not found in texture '%s'\n", sc.String, tex? tex->Name.GetChars() : "(null)"); Printf("Brightmap '%s' not found in texture '%s'\n", sc.String, tex? tex->Name.GetChars() : "(null)");
@ -789,7 +789,7 @@ void AddAutoMaterials()
TArray<FTextureID> list; TArray<FTextureID> list;
FString texname = ExtractFileBase(name, false); FString texname = ExtractFileBase(name, false);
TexMan.ListTextures(texname, list); TexMan.ListTextures(texname, list);
auto bmtex = TexMan.FindTexture(name, FTexture::TEX_Any, FTextureManager::TEXMAN_TryAny); auto bmtex = TexMan.FindTexture(name, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
for (auto texid : list) for (auto texid : list)
{ {
bmtex->bMasked = false; bmtex->bMasked = false;
@ -946,7 +946,7 @@ void gl_PrecacheTexture(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitl
{ {
if (smf->skinIDs[i].isValid()) if (smf->skinIDs[i].isValid())
{ {
texhitlist[smf->skinIDs[i].GetIndex()] |= FTexture::TEX_Flat; texhitlist[smf->skinIDs[i].GetIndex()] |= FTextureManager::HIT_Flat;
} }
else if (smf->modelIDs[i] != -1) else if (smf->modelIDs[i] != -1)
{ {

View File

@ -117,7 +117,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
} }
if (texname[0] != 0) if (texname[0] != 0)
{ {
mBackground = TexMan.CheckForTexture(texname, FTexture::TEX_MiscPatch); mBackground = TexMan.CheckForTexture(texname, ETextureType::MiscPatch);
mFlatfill = desc->mFlatfill; mFlatfill = desc->mFlatfill;
} }
S_Sound (CHAN_VOICE | CHAN_UI, desc->mSound, 1.0f, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, desc->mSound, 1.0f, ATTN_NONE);
@ -147,7 +147,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
mOverlays[i].x = desc->mOverlays[i].x; mOverlays[i].x = desc->mOverlays[i].x;
mOverlays[i].y = desc->mOverlays[i].y; mOverlays[i].y = desc->mOverlays[i].y;
mOverlays[i].mCondition = desc->mOverlays[i].mCondition; mOverlays[i].mCondition = desc->mOverlays[i].mCondition;
mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName, FTexture::TEX_MiscPatch); mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName, ETextureType::MiscPatch);
} }
mTicker = 0; mTicker = 0;
} }
@ -640,7 +640,7 @@ void DIntermissionScreenScroller::Init(FIntermissionAction *desc, bool first)
{ {
Super::Init(desc, first); Super::Init(desc, first);
mFirstPic = mBackground; mFirstPic = mBackground;
mSecondPic = TexMan.CheckForTexture(static_cast<FIntermissionActionScroller*>(desc)->mSecondPic, FTexture::TEX_MiscPatch); mSecondPic = TexMan.CheckForTexture(static_cast<FIntermissionActionScroller*>(desc)->mSecondPic, ETextureType::MiscPatch);
mScrollDelay = static_cast<FIntermissionActionScroller*>(desc)->mScrollDelay; mScrollDelay = static_cast<FIntermissionActionScroller*>(desc)->mScrollDelay;
mScrollTime = static_cast<FIntermissionActionScroller*>(desc)->mScrollTime; mScrollTime = static_cast<FIntermissionActionScroller*>(desc)->mScrollTime;
mScrollDir = static_cast<FIntermissionActionScroller*>(desc)->mScrollDir; mScrollDir = static_cast<FIntermissionActionScroller*>(desc)->mScrollDir;

View File

@ -161,7 +161,7 @@ void DeinitMenus()
static FTextureID GetMenuTexture(const char* const name) static FTextureID GetMenuTexture(const char* const name)
{ {
const FTextureID texture = TexMan.CheckForTexture(name, FTexture::TEX_MiscPatch); const FTextureID texture = TexMan.CheckForTexture(name, ETextureType::MiscPatch);
if (!texture.Exists() && mustPrintErrors) if (!texture.Exists() && mustPrintErrors)
{ {
@ -417,7 +417,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc)
} }
else if (args[i] == TypeTextureID) else if (args[i] == TypeTextureID)
{ {
auto f = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch); auto f = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
if (!f.Exists()) if (!f.Exists())
{ {
sc.ScriptMessage("Unknown texture %s", sc.String); sc.ScriptMessage("Unknown texture %s", sc.String);

View File

@ -3873,7 +3873,7 @@ void DLevelScript::ChangeFlat (int tag, int name, bool floorOrCeiling)
if (flatname == NULL) if (flatname == NULL)
return; return;
flat = TexMan.GetTexture (flatname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); flat = TexMan.GetTexture (flatname, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
FSectorTagIterator it(tag); FSectorTagIterator it(tag);
while ((secnum = it.Next()) >= 0) while ((secnum = it.Next()) >= 0)
@ -3905,7 +3905,7 @@ void DLevelScript::SetLineTexture (int lineid, int side, int position, int name)
side = !!side; side = !!side;
texture = TexMan.GetTexture (texname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); texture = TexMan.GetTexture (texname, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
FLineIdIterator itr(lineid); FLineIdIterator itr(lineid);
while ((linenum = itr.Next()) >= 0) while ((linenum = itr.Next()) >= 0)
@ -4700,7 +4700,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
{ {
return 0; return 0;
} }
FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string), FTexture::TEX_Flat, FTexture *tex = TexMan.FindTexture(FBehavior::StaticLookupString(string), ETextureType::Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_DontCreate); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_DontCreate);
if (tex == NULL) if (tex == NULL)
@ -10033,11 +10033,11 @@ scriptwait:
sky2name = FBehavior::StaticLookupString (STACK(1)); sky2name = FBehavior::StaticLookupString (STACK(1));
if (sky1name[0] != 0) if (sky1name[0] != 0)
{ {
sky1texture = level.skytexture1 = TexMan.GetTexture (sky1name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst); sky1texture = level.skytexture1 = TexMan.GetTexture (sky1name, ETextureType::Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
} }
if (sky2name[0] != 0) if (sky2name[0] != 0)
{ {
sky2texture = level.skytexture2 = TexMan.GetTexture (sky2name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst); sky2texture = level.skytexture2 = TexMan.GetTexture (sky2name, ETextureType::Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_ReturnFirst);
} }
R_InitSkyMap (); R_InitSkyMap ();
sp -= 2; sp -= 2;
@ -10061,7 +10061,7 @@ scriptwait:
if (camera != NULL) if (camera != NULL)
{ {
FTextureID picnum = TexMan.CheckForTexture (picname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.CheckForTexture (picname, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
if (!picnum.Exists()) if (!picnum.Exists())
{ {
Printf ("SetCameraToTexture: %s is not a texture\n", picname); Printf ("SetCameraToTexture: %s is not a texture\n", picname);

View File

@ -4888,8 +4888,8 @@ bool P_LineTrace(AActor *t1, DAngle angle, double distance,
ActorFlags aflags = (flags & TRF_ALLACTORS) ? ActorFlags::FromInt(0xFFFFFFFF) : MF_SHOOTABLE; ActorFlags aflags = (flags & TRF_ALLACTORS) ? ActorFlags::FromInt(0xFFFFFFFF) : MF_SHOOTABLE;
int lflags = 0; int lflags = 0;
if ( !(lflags & TRF_THRUBLOCK) ) lflags |= ML_BLOCKEVERYTHING; if ( !(flags & TRF_THRUBLOCK) ) lflags |= ML_BLOCKEVERYTHING;
if ( !(lflags & TRF_THRUHITSCAN) ) lflags |= ML_BLOCKHITSCAN; if ( !(flags & TRF_THRUHITSCAN) ) lflags |= ML_BLOCKHITSCAN;
int tflags = TRACE_ReportPortals; int tflags = TRACE_ReportPortals;
if ( flags & TRF_NOSKY ) tflags |= TRACE_NoSky; if ( flags & TRF_NOSKY ) tflags |= TRACE_NoSky;

View File

@ -2250,8 +2250,8 @@ void P_ReplaceTextures(const char *fromname, const char *toname, int flags)
if ((flags ^ (NOT_BOTTOM | NOT_MIDDLE | NOT_TOP)) != 0) if ((flags ^ (NOT_BOTTOM | NOT_MIDDLE | NOT_TOP)) != 0)
{ {
picnum1 = TexMan.GetTexture(fromname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); picnum1 = TexMan.GetTexture(fromname, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
picnum2 = TexMan.GetTexture(toname, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); picnum2 = TexMan.GetTexture(toname, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
for (auto &side : level.sides) for (auto &side : level.sides)
{ {
@ -2267,8 +2267,8 @@ void P_ReplaceTextures(const char *fromname, const char *toname, int flags)
} }
if ((flags ^ (NOT_FLOOR | NOT_CEILING)) != 0) if ((flags ^ (NOT_FLOOR | NOT_CEILING)) != 0)
{ {
picnum1 = TexMan.GetTexture(fromname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); picnum1 = TexMan.GetTexture(fromname, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
picnum2 = TexMan.GetTexture(toname, FTexture::TEX_Flat, FTextureManager::TEXMAN_Overridable); picnum2 = TexMan.GetTexture(toname, ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
for (auto &sec : level.sectors) for (auto &sec : level.sectors)
{ {

View File

@ -568,7 +568,7 @@ static void SetTexture (side_t *side, int position, const char *name, FMissingTe
static const char *positionnames[] = { "top", "middle", "bottom" }; static const char *positionnames[] = { "top", "middle", "bottom" };
static const char *sidenames[] = { "first", "second" }; static const char *sidenames[] = { "first", "second" };
FTextureID texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall, FTextureID texture = TexMan.CheckForTexture (name, ETextureType::Wall,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!texture.Exists()) if (!texture.Exists())
@ -614,7 +614,7 @@ void SetTexture (sector_t *sector, int index, int position, const char *name, FM
name = name8; name = name8;
} }
FTextureID texture = TexMan.CheckForTexture (name, FTexture::TEX_Flat, FTextureID texture = TexMan.CheckForTexture (name, ETextureType::Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!texture.Exists()) if (!texture.Exists())
@ -668,7 +668,7 @@ static void SetTexture (side_t *side, int position, uint32_t *blend, const char
FTextureID texture; FTextureID texture;
if ((*blend = R_ColormapNumForName (name)) == 0) if ((*blend = R_ColormapNumForName (name)) == 0)
{ {
texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall, texture = TexMan.CheckForTexture (name, ETextureType::Wall,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!texture.Exists()) if (!texture.Exists())
{ {
@ -701,7 +701,7 @@ static void SetTextureNoErr (side_t *side, int position, uint32_t *color, const
{ {
FTextureID texture; FTextureID texture;
*validcolor = false; *validcolor = false;
texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall, texture = TexMan.CheckForTexture (name, ETextureType::Wall,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!texture.Exists()) if (!texture.Exists())
{ {
@ -3482,12 +3482,12 @@ static void P_PrecacheLevel()
for (auto n : gameinfo.PrecachedTextures) for (auto n : gameinfo.PrecachedTextures)
{ {
FTextureID tex = TexMan.CheckForTexture(n, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); FTextureID tex = TexMan.CheckForTexture(n, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall; if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall;
} }
for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++) for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++)
{ {
FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall; if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall;
} }

View File

@ -631,7 +631,7 @@ static void ParseFloor (FScanner &sc)
bool opt = sc.CheckString("optional"); bool opt = sc.CheckString("optional");
sc.MustGetString (); sc.MustGetString ();
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Flat, picnum = TexMan.CheckForTexture (sc.String, ETextureType::Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny); FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);
if (!picnum.Exists()) if (!picnum.Exists())

View File

@ -50,7 +50,7 @@ void RenderPolyDecal::Render(PolyRenderThread *thread, const TriMatrix &worldToC
return; return;
FTexture *tex = TexMan(decal->PicNum, true); FTexture *tex = TexMan(decal->PicNum, true);
if (tex == nullptr || tex->UseType == FTexture::TEX_Null) if (tex == nullptr || tex->UseType == ETextureType::Null)
return; return;
sector_t *front, *back; sector_t *front, *back;

View File

@ -67,7 +67,7 @@ void RenderPolyPlane::RenderNormal(PolyRenderThread *thread, const TriMatrix &wo
if (picnum != skyflatnum) if (picnum != skyflatnum)
{ {
FTexture *tex = TexMan(picnum); FTexture *tex = TexMan(picnum);
if (!tex || tex->UseType == FTexture::TEX_Null) if (!tex || tex->UseType == ETextureType::Null)
return; return;
PolyPlaneUVTransform transform = PolyPlaneUVTransform(ceiling ? fakeflat.FrontSector->planes[sector_t::ceiling].xform : fakeflat.FrontSector->planes[sector_t::floor].xform, tex); PolyPlaneUVTransform transform = PolyPlaneUVTransform(ceiling ? fakeflat.FrontSector->planes[sector_t::ceiling].xform : fakeflat.FrontSector->planes[sector_t::floor].xform, tex);
@ -516,7 +516,7 @@ void Render3DFloorPlane::Render(PolyRenderThread *thread, const TriMatrix &world
{ {
FTextureID picnum = ceiling ? *fakeFloor->bottom.texture : *fakeFloor->top.texture; FTextureID picnum = ceiling ? *fakeFloor->bottom.texture : *fakeFloor->top.texture;
FTexture *tex = TexMan(picnum); FTexture *tex = TexMan(picnum);
if (tex->UseType == FTexture::TEX_Null) if (tex->UseType == ETextureType::Null)
return; return;
PolyCameraLight *cameraLight = PolyCameraLight::Instance(); PolyCameraLight *cameraLight = PolyCameraLight::Instance();

View File

@ -224,7 +224,7 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
flip = sprframe->Flip & 1; flip = sprframe->Flip & 1;
tex = TexMan(picnum); tex = TexMan(picnum);
if (tex->UseType == FTexture::TEX_Null) if (tex->UseType == ETextureType::Null)
return; return;
if (pspr->firstTic) if (pspr->firstTic)

View File

@ -342,7 +342,7 @@ void PolySkySetup::Update()
} }
frontskytex = TexMan(s->GetTexture(pos), true); frontskytex = TexMan(s->GetTexture(pos), true);
if (frontskytex == nullptr || frontskytex->UseType == FTexture::TEX_Null) if (frontskytex == nullptr || frontskytex->UseType == ETextureType::Null)
{ // [RH] The blank texture: Use normal sky instead. { // [RH] The blank texture: Use normal sky instead.
goto sky1; goto sky1;
} }

View File

@ -104,7 +104,7 @@ void RenderPolySprite::Render(PolyRenderThread *thread, const TriMatrix &worldTo
bool flipTextureX = false; bool flipTextureX = false;
FTexture *tex = GetSpriteTexture(thing, flipTextureX); FTexture *tex = GetSpriteTexture(thing, flipTextureX);
if (tex == nullptr || tex->UseType == FTexture::TEX_Null) if (tex == nullptr || tex->UseType == ETextureType::Null)
return; return;
double thingyscalemul = thing->Scale.Y / tex->Scale.Y; double thingyscalemul = thing->Scale.Y / tex->Scale.Y;
@ -315,7 +315,7 @@ FTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool &flipX)
if (thing->picnum.isValid()) if (thing->picnum.isValid())
{ {
FTexture *tex = TexMan(thing->picnum); FTexture *tex = TexMan(thing->picnum);
if (tex->UseType == FTexture::TEX_Null) if (tex->UseType == ETextureType::Null)
{ {
return nullptr; return nullptr;
} }

View File

@ -173,7 +173,7 @@ bool RenderPolyWall::RenderLine(PolyRenderThread *thread, const TriMatrix &world
wall.FogBoundary = IsFogBoundary(frontsector, backsector); wall.FogBoundary = IsFogBoundary(frontsector, backsector);
FTexture *midtex = TexMan(line->sidedef->GetTexture(side_t::mid), true); FTexture *midtex = TexMan(line->sidedef->GetTexture(side_t::mid), true);
if ((midtex && midtex->UseType != FTexture::TEX_Null) || wall.FogBoundary) if ((midtex && midtex->UseType != ETextureType::Null) || wall.FogBoundary)
translucentWallsOutput.push_back(thread->FrameMemory->NewObject<PolyTranslucentWall>(wall)); translucentWallsOutput.push_back(thread->FrameMemory->NewObject<PolyTranslucentWall>(wall));
if (polyportal) if (polyportal)
@ -519,7 +519,7 @@ void RenderPolyWall::ClampHeight(TriVertex &v1, TriVertex &v2)
FTexture *RenderPolyWall::GetTexture(const line_t *line, const side_t *side, side_t::ETexpart texpart) FTexture *RenderPolyWall::GetTexture(const line_t *line, const side_t *side, side_t::ETexpart texpart)
{ {
FTexture *tex = TexMan(side->GetTexture(texpart), true); FTexture *tex = TexMan(side->GetTexture(texpart), true);
if (tex == nullptr || tex->UseType == FTexture::TEX_Null) if (tex == nullptr || tex->UseType == ETextureType::Null)
{ {
// Mapping error. Doom floodfills this with a plane. // Mapping error. Doom floodfills this with a plane.
// This code doesn't do that, but at least it uses the "right" texture.. // This code doesn't do that, but at least it uses the "right" texture..
@ -539,7 +539,7 @@ FTexture *RenderPolyWall::GetTexture(const line_t *line, const side_t *side, sid
tex = TexMan(line->frontsector->GetTexture(sector_t::floor), true); tex = TexMan(line->frontsector->GetTexture(sector_t::floor), true);
} }
if (tex == nullptr || tex->UseType == FTexture::TEX_Null) if (tex == nullptr || tex->UseType == ETextureType::Null)
return nullptr; return nullptr;
} }
return tex; return tex;

View File

@ -41,7 +41,7 @@ void RenderPolyWallSprite::Render(PolyRenderThread *thread, const TriMatrix &wor
bool flipTextureX = false; bool flipTextureX = false;
FTexture *tex = RenderPolySprite::GetSpriteTexture(thing, flipTextureX); FTexture *tex = RenderPolySprite::GetSpriteTexture(thing, flipTextureX);
if (tex == nullptr || tex->UseType == FTexture::TEX_Null) if (tex == nullptr || tex->UseType == ETextureType::Null)
return; return;
DVector2 spriteScale = thing->Scale; DVector2 spriteScale = thing->Scale;

View File

@ -1462,7 +1462,7 @@ bool I_SetCursor(FTexture* cursorpic)
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSCursor* cursor = nil; NSCursor* cursor = nil;
if (NULL != cursorpic && FTexture::TEX_Null != cursorpic->UseType) if (NULL != cursorpic && ETextureType::Null != cursorpic->UseType)
{ {
// Create bitmap image representation // Create bitmap image representation

View File

@ -44,7 +44,7 @@ bool I_SetCursor(FTexture *cursorpic)
static SDL_Cursor *cursor; static SDL_Cursor *cursor;
static SDL_Surface *cursorSurface; static SDL_Surface *cursorSurface;
if (cursorpic != NULL && cursorpic->UseType != FTexture::TEX_Null) if (cursorpic != NULL && cursorpic->UseType != ETextureType::Null)
{ {
// Must be no larger than 32x32. // Must be no larger than 32x32.
if (cursorpic->GetWidth() > 32 || cursorpic->GetHeight() > 32) if (cursorpic->GetWidth() > 32 || cursorpic->GetHeight() > 32)

View File

@ -356,7 +356,7 @@ FTextureID LoadSkin(const char * path, const char * fn)
int texlump = FindGFXFile(buffer); int texlump = FindGFXFile(buffer);
const char * const texname = texlump < 0 ? fn : Wads.GetLumpFullName(texlump); const char * const texname = texlump < 0 ? fn : Wads.GetLumpFullName(texlump);
return TexMan.CheckForTexture(texname, FTexture::TEX_Any, FTextureManager::TEXMAN_TryAny); return TexMan.CheckForTexture(texname, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
} }
//=========================================================================== //===========================================================================

View File

@ -333,7 +333,7 @@ void FDMDModel::AddSkins(uint8_t *hitlist)
{ {
if (skins[i].isValid()) if (skins[i].isValid())
{ {
hitlist[skins[i].GetIndex()] |= FTexture::TEX_Flat; hitlist[skins[i].GetIndex()] |= FTextureManager::HIT_Flat;
} }
} }
} }

View File

@ -305,7 +305,7 @@ void FMD3Model::AddSkins(uint8_t *hitlist)
{ {
if (curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].isValid()) if (curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].isValid())
{ {
hitlist[curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].GetIndex()] |= FTexture::TEX_Flat; hitlist[curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i].GetIndex()] |= FTextureManager::HIT_Flat;
} }
MD3Surface * surf = &surfaces[i]; MD3Surface * surf = &surfaces[i];
@ -313,7 +313,7 @@ void FMD3Model::AddSkins(uint8_t *hitlist)
{ {
if (surf->skins[j].isValid()) if (surf->skins[j].isValid())
{ {
hitlist[surf->skins[j].GetIndex()] |= FTexture::TEX_Flat; hitlist[surf->skins[j].GetIndex()] |= FTextureManager::HIT_Flat;
} }
} }
} }

View File

@ -361,7 +361,7 @@ void FVoxelModel::BuildVertexBuffer(FModelRenderer *renderer)
void FVoxelModel::AddSkins(uint8_t *hitlist) void FVoxelModel::AddSkins(uint8_t *hitlist)
{ {
hitlist[mPalette.GetIndex()] |= FTexture::TEX_Flat; hitlist[mPalette.GetIndex()] |= FTextureManager::HIT_Flat;
} }
//=========================================================================== //===========================================================================

View File

@ -337,7 +337,7 @@ void R_InitSpriteDefs ()
for (i = 0; i < smax; ++i) for (i = 0; i < smax; ++i)
{ {
FTexture *tex = TexMan.ByIndex(i); FTexture *tex = TexMan.ByIndex(i);
if (tex->UseType == FTexture::TEX_Sprite && strlen(tex->Name) >= 6) if (tex->UseType == ETextureType::Sprite && strlen(tex->Name) >= 6)
{ {
size_t bucket = TEX_DWNAME(tex) % smax; size_t bucket = TEX_DWNAME(tex) % smax;
hashes[i].Next = hashes[bucket].Head; hashes[i].Next = hashes[bucket].Head;
@ -856,7 +856,7 @@ void R_InitSkins (void)
memcpy(&lnameint, lname, 4); memcpy(&lnameint, lname, 4);
if (lnameint == intname) if (lnameint == intname)
{ {
FTextureID picnum = TexMan.CreateTexture(k, FTexture::TEX_SkinSprite); FTextureID picnum = TexMan.CreateTexture(k, ETextureType::SkinSprite);
bool res = R_InstallSpriteLump (picnum, lname[4] - 'A', lname[5], false, sprtemp, maxframe); bool res = R_InstallSpriteLump (picnum, lname[4] - 'A', lname[5], false, sprtemp, maxframe);
if (lname[6] && res) if (lname[6] && res)

View File

@ -84,11 +84,11 @@ void R_InitSkyMap ()
// Do not allow the null texture which has no bitmap and will crash. // Do not allow the null texture which has no bitmap and will crash.
if (sky1texture.isNull()) if (sky1texture.isNull())
{ {
sky1texture = TexMan.CheckForTexture("-noflat-", FTexture::TEX_Any); sky1texture = TexMan.CheckForTexture("-noflat-", ETextureType::Any);
} }
if (sky2texture.isNull()) if (sky2texture.isNull())
{ {
sky2texture = TexMan.CheckForTexture("-noflat-", FTexture::TEX_Any); sky2texture = TexMan.CheckForTexture("-noflat-", ETextureType::Any);
} }
skytex1 = TexMan(sky1texture, true); skytex1 = TexMan(sky1texture, true);

View File

@ -1062,7 +1062,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, SetCameraToTexture)
PARAM_OBJECT(viewpoint, AActor); PARAM_OBJECT(viewpoint, AActor);
PARAM_STRING(texturename); // [ZZ] there is no point in having this as FTextureID because it's easier to refer to a cameratexture by name and it isn't executed too often to cache it. PARAM_STRING(texturename); // [ZZ] there is no point in having this as FTextureID because it's easier to refer to a cameratexture by name and it isn't executed too often to cache it.
PARAM_FLOAT(fov); PARAM_FLOAT(fov);
FTextureID textureid = TexMan.CheckForTexture(texturename, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); FTextureID textureid = TexMan.CheckForTexture(texturename, ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
FCanvasTextureInfo::Add(viewpoint, textureid, fov); FCanvasTextureInfo::Add(viewpoint, textureid, fov);
return 0; return 0;
} }

View File

@ -1147,7 +1147,7 @@ static void SetIcon(FTextureID &icon, Baggage &bag, const char *i)
} }
else else
{ {
icon = TexMan.CheckForTexture(i, FTexture::TEX_MiscPatch); icon = TexMan.CheckForTexture(i, ETextureType::MiscPatch);
if (!icon.isValid()) if (!icon.isValid())
{ {
// Don't print warnings if the item is for another game or if this is a shareware IWAD. // Don't print warnings if the item is for another game or if this is a shareware IWAD.
@ -1609,7 +1609,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, sidemove, F_f, PlayerPawn)
DEFINE_CLASS_PROPERTY_PREFIX(player, scoreicon, S, PlayerPawn) DEFINE_CLASS_PROPERTY_PREFIX(player, scoreicon, S, PlayerPawn)
{ {
PROP_STRING_PARM(z, 0); PROP_STRING_PARM(z, 0);
defaults->ScoreIcon = TexMan.CheckForTexture(z, FTexture::TEX_MiscPatch); defaults->ScoreIcon = TexMan.CheckForTexture(z, ETextureType::MiscPatch);
if (!defaults->ScoreIcon.isValid()) if (!defaults->ScoreIcon.isValid())
{ {
bag.ScriptPosition.Message(MSG_WARNING, bag.ScriptPosition.Message(MSG_WARNING,

View File

@ -1531,7 +1531,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
arc.WriteKey(key); arc.WriteKey(key);
arc.w->StartArray(); arc.w->StartArray();
arc.w->String(name); arc.w->String(name);
arc.w->Int(pic->UseType); arc.w->Int(static_cast<int>(pic->UseType));
arc.w->EndArray(); arc.w->EndArray();
} }
} }
@ -1547,7 +1547,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
assert(nameval.IsString() && typeval.IsInt()); assert(nameval.IsString() && typeval.IsInt());
if (nameval.IsString() && typeval.IsInt()) if (nameval.IsString() && typeval.IsInt())
{ {
value = TexMan.GetTexture(UnicodeToString(nameval.GetString()), typeval.GetInt()); value = TexMan.GetTexture(UnicodeToString(nameval.GetString()), static_cast<ETextureType>(typeval.GetInt()));
} }
else else
{ {

View File

@ -105,7 +105,7 @@ const char *BaseFileSearch(const char *file, const char *ext, bool lookfirstinpr
CVAR(String, fluid_lib, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(String, fluid_lib, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CUSTOM_CVAR(String, fluid_patchset, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(String, fluid_patchset, "gzdoom", CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_FLUIDSYNTH) if (currSong != nullptr && currSong->GetDeviceType() == MDEV_FLUIDSYNTH)
{ {

View File

@ -78,7 +78,7 @@ protected:
TimidityPlus::Instruments *TimidityPPMIDIDevice::instruments; TimidityPlus::Instruments *TimidityPPMIDIDevice::instruments;
// Config file to use // Config file to use
CUSTOM_CVAR(String, timidity_config, "timidity.cfg", CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(String, timidity_config, "gzdoom", CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_TIMIDITY) if (currSong != nullptr && currSong->GetDeviceType() == MDEV_TIMIDITY)
{ {

View File

@ -36,7 +36,7 @@
#include "v_text.h" #include "v_text.h"
#include "timidity.h" #include "timidity.h"
CUSTOM_CVAR(String, midi_config, CONFIG_FILE, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(String, midi_config, "gzdoom", CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
Timidity::FreeAll(); Timidity::FreeAll();
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_GUS) if (currSong != nullptr && currSong->GetDeviceType() == MDEV_GUS)

View File

@ -86,9 +86,6 @@ config.h
#define MAX_AMPLIFICATION 800 #define MAX_AMPLIFICATION 800
/* The TiMiditiy configuration file */
#define CONFIG_FILE "timidity.cfg"
typedef float sample_t; typedef float sample_t;
typedef float final_volume_t; typedef float final_volume_t;
#define FINAL_VOLUME(v) (v) #define FINAL_VOLUME(v) (v)

View File

@ -424,7 +424,7 @@ namespace swrenderer
if (!onlyUpdatePlaneClip) if (!onlyUpdatePlaneClip)
// allocate space for masked texture tables, if needed // allocate space for masked texture tables, if needed
// [RH] Don't just allocate the space; fill it in too. // [RH] Don't just allocate the space; fill it in too.
if ((TexMan(sidedef->GetTexture(side_t::mid), true)->UseType != FTexture::TEX_Null || draw_segment->Has3DFloorWalls() || IsFogBoundary(mFrontSector, mBackSector)) && if ((TexMan(sidedef->GetTexture(side_t::mid), true)->UseType != ETextureType::Null || draw_segment->Has3DFloorWalls() || IsFogBoundary(mFrontSector, mBackSector)) &&
(mCeilingClipped != ProjectedWallCull::OutsideBelow || !sidedef->GetTexture(side_t::top).isValid()) && (mCeilingClipped != ProjectedWallCull::OutsideBelow || !sidedef->GetTexture(side_t::top).isValid()) &&
(mFloorClipped != ProjectedWallCull::OutsideAbove || !sidedef->GetTexture(side_t::bottom).isValid()) && (mFloorClipped != ProjectedWallCull::OutsideAbove || !sidedef->GetTexture(side_t::bottom).isValid()) &&
(WallC.sz1 >= TOO_CLOSE_Z && WallC.sz2 >= TOO_CLOSE_Z)) (WallC.sz1 >= TOO_CLOSE_Z && WallC.sz2 >= TOO_CLOSE_Z))
@ -1100,7 +1100,7 @@ namespace swrenderer
} }
else else
{ // two sided line { // two sided line
if (mTopPart.Texture != NULL && mTopPart.Texture->UseType != FTexture::TEX_Null) if (mTopPart.Texture != NULL && mTopPart.Texture->UseType != ETextureType::Null)
{ // top wall { // top wall
for (int x = x1; x < x2; ++x) for (int x = x1; x < x2; ++x)
{ {
@ -1113,7 +1113,7 @@ namespace swrenderer
memcpy(ceilingclip + x1, walltop.ScreenY + x1, (x2 - x1) * sizeof(short)); memcpy(ceilingclip + x1, walltop.ScreenY + x1, (x2 - x1) * sizeof(short));
} }
if (mBottomPart.Texture != NULL && mBottomPart.Texture->UseType != FTexture::TEX_Null) if (mBottomPart.Texture != NULL && mBottomPart.Texture->UseType != ETextureType::Null)
{ // bottom wall { // bottom wall
for (int x = x1; x < x2; ++x) for (int x = x1; x < x2; ++x)
{ {
@ -1131,7 +1131,7 @@ namespace swrenderer
void SWRenderLine::RenderTopTexture(int x1, int x2) void SWRenderLine::RenderTopTexture(int x1, int x2)
{ {
if (mMiddlePart.Texture) return; if (mMiddlePart.Texture) return;
if (!mTopPart.Texture || mTopPart.Texture->UseType == FTexture::TEX_Null) return; if (!mTopPart.Texture || mTopPart.Texture->UseType == ETextureType::Null) return;
if (!viewactive) return; if (!viewactive) return;
FTexture *rw_pic = mTopPart.Texture; FTexture *rw_pic = mTopPart.Texture;
@ -1178,7 +1178,7 @@ namespace swrenderer
void SWRenderLine::RenderMiddleTexture(int x1, int x2) void SWRenderLine::RenderMiddleTexture(int x1, int x2)
{ {
if (!mMiddlePart.Texture || mMiddlePart.Texture->UseType == FTexture::TEX_Null) return; if (!mMiddlePart.Texture || mMiddlePart.Texture->UseType == ETextureType::Null) return;
if (!viewactive) return; if (!viewactive) return;
FTexture *rw_pic = mMiddlePart.Texture; FTexture *rw_pic = mMiddlePart.Texture;
@ -1226,7 +1226,7 @@ namespace swrenderer
void SWRenderLine::RenderBottomTexture(int x1, int x2) void SWRenderLine::RenderBottomTexture(int x1, int x2)
{ {
if (mMiddlePart.Texture) return; if (mMiddlePart.Texture) return;
if (!mBottomPart.Texture || mBottomPart.Texture->UseType == FTexture::TEX_Null) return; if (!mBottomPart.Texture || mBottomPart.Texture->UseType == ETextureType::Null) return;
if (!viewactive) return; if (!viewactive) return;
FTexture *rw_pic = mBottomPart.Texture; FTexture *rw_pic = mBottomPart.Texture;

View File

@ -327,7 +327,7 @@ namespace swrenderer
void RenderWallPart::ProcessWallWorker(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal) void RenderWallPart::ProcessWallWorker(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal)
{ {
if (rw_pic->UseType == FTexture::TEX_Null) if (rw_pic->UseType == ETextureType::Null)
return; return;
int fracbits = 32 - rw_pic->HeightBits; int fracbits = 32 - rw_pic->HeightBits;

View File

@ -126,7 +126,7 @@ namespace swrenderer
} }
frontskytex = TexMan(s->GetTexture(pos), true); frontskytex = TexMan(s->GetTexture(pos), true);
if (frontskytex == NULL || frontskytex->UseType == FTexture::TEX_Null) if (frontskytex == NULL || frontskytex->UseType == ETextureType::Null)
{ // [RH] The blank texture: Use normal sky instead. { // [RH] The blank texture: Use normal sky instead.
goto sky1; goto sky1;
} }

View File

@ -115,7 +115,7 @@ namespace swrenderer
{ {
FTexture *tex = TexMan(picnum, true); FTexture *tex = TexMan(picnum, true);
if (tex->UseType == FTexture::TEX_Null) if (tex->UseType == ETextureType::Null)
{ {
return; return;
} }

View File

@ -1042,7 +1042,7 @@ namespace swrenderer
sprite.picnum = thing->picnum; sprite.picnum = thing->picnum;
sprite.tex = TexMan(sprite.picnum); sprite.tex = TexMan(sprite.picnum);
if (sprite.tex->UseType == FTexture::TEX_Null) if (sprite.tex->UseType == ETextureType::Null)
{ {
return false; return false;
} }
@ -1114,7 +1114,7 @@ namespace swrenderer
return false; return false;
} }
if (sprite.voxel == nullptr && (sprite.tex == nullptr || sprite.tex->UseType == FTexture::TEX_Null)) if (sprite.voxel == nullptr && (sprite.tex == nullptr || sprite.tex->UseType == ETextureType::Null))
{ {
return false; return false;
} }

View File

@ -132,7 +132,7 @@ namespace swrenderer
FTexture *WallSpriteTile = TexMan(decal->PicNum, true); FTexture *WallSpriteTile = TexMan(decal->PicNum, true);
flipx = (uint8_t)(decal->RenderFlags & RF_XFLIP); flipx = (uint8_t)(decal->RenderFlags & RF_XFLIP);
if (WallSpriteTile == NULL || WallSpriteTile->UseType == FTexture::TEX_Null) if (WallSpriteTile == NULL || WallSpriteTile->UseType == ETextureType::Null)
{ {
return; return;
} }

View File

@ -228,7 +228,7 @@ namespace swrenderer
flip = sprframe->Flip & 1; flip = sprframe->Flip & 1;
tex = TexMan(picnum); tex = TexMan(picnum);
if (tex->UseType == FTexture::TEX_Null) if (tex->UseType == ETextureType::Null)
return; return;
if (pspr->firstTic) if (pspr->firstTic)

View File

@ -81,13 +81,13 @@ void FTextureManager::InitSwitchList ()
continue; continue;
} }
// [RH] Skip this switch if its textures can't be found. // [RH] Skip this switch if its textures can't be found.
if (CheckForTexture (list_p /* .name1 */, FTexture::TEX_Wall, texflags).Exists() && if (CheckForTexture (list_p /* .name1 */, ETextureType::Wall, texflags).Exists() &&
CheckForTexture (list_p + 9 /* .name2 */, FTexture::TEX_Wall, texflags).Exists()) CheckForTexture (list_p + 9 /* .name2 */, ETextureType::Wall, texflags).Exists())
{ {
def1 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef)); def1 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef)); def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
def1->PreTexture = def2->frames[0].Texture = CheckForTexture (list_p /* .name1 */, FTexture::TEX_Wall, texflags); def1->PreTexture = def2->frames[0].Texture = CheckForTexture (list_p /* .name1 */, ETextureType::Wall, texflags);
def2->PreTexture = def1->frames[0].Texture = CheckForTexture (list_p + 9, FTexture::TEX_Wall, texflags); def2->PreTexture = def1->frames[0].Texture = CheckForTexture (list_p + 9, ETextureType::Wall, texflags);
def1->Sound = def2->Sound = 0; def1->Sound = def2->Sound = 0;
def1->NumFrames = def2->NumFrames = 1; def1->NumFrames = def2->NumFrames = 1;
def1->frames[0].TimeMin = def2->frames[0].TimeMin = 0; def1->frames[0].TimeMin = def2->frames[0].TimeMin = 0;
@ -148,7 +148,7 @@ void FTextureManager::ProcessSwitchDef (FScanner &sc)
} }
sc.MustGetString (); sc.MustGetString ();
picnum = CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); picnum = CheckForTexture (sc.String, ETextureType::Wall, texflags);
picname = sc.String; picname = sc.String;
while (sc.GetString ()) while (sc.GetString ())
{ {
@ -247,7 +247,7 @@ FSwitchDef *FTextureManager::ParseSwitchDef (FScanner &sc, bool ignoreBad)
else if (sc.Compare ("pic")) else if (sc.Compare ("pic"))
{ {
sc.MustGetString (); sc.MustGetString ();
picnum = CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); picnum = CheckForTexture (sc.String, ETextureType::Wall, texflags);
if (!picnum.Exists() && !ignoreBad) if (!picnum.Exists() && !ignoreBad)
{ {
//Printf ("Unknown switch texture %s\n", sc.String); //Printf ("Unknown switch texture %s\n", sc.String);

View File

@ -206,8 +206,8 @@ void FTextureManager::InitAnimated (void)
if (*anim_p /* .istexture */ & 1) if (*anim_p /* .istexture */ & 1)
{ {
// different episode ? // different episode ?
if (!(pic1 = CheckForTexture ((const char*)(anim_p + 10) /* .startname */, FTexture::TEX_Wall, texflags)).Exists() || if (!(pic1 = CheckForTexture ((const char*)(anim_p + 10) /* .startname */, ETextureType::Wall, texflags)).Exists() ||
!(pic2 = CheckForTexture ((const char*)(anim_p + 1) /* .endname */, FTexture::TEX_Wall, texflags)).Exists()) !(pic2 = CheckForTexture ((const char*)(anim_p + 1) /* .endname */, ETextureType::Wall, texflags)).Exists())
continue; continue;
// [RH] Bit 1 set means allow decals on walls with this texture // [RH] Bit 1 set means allow decals on walls with this texture
@ -215,8 +215,8 @@ void FTextureManager::InitAnimated (void)
} }
else else
{ {
if (!(pic1 = CheckForTexture ((const char*)(anim_p + 10) /* .startname */, FTexture::TEX_Flat, texflags)).Exists() || if (!(pic1 = CheckForTexture ((const char*)(anim_p + 10) /* .startname */, ETextureType::Flat, texflags)).Exists() ||
!(pic2 = CheckForTexture ((const char*)(anim_p + 1) /* .startname */, FTexture::TEX_Flat, texflags)).Exists()) !(pic2 = CheckForTexture ((const char*)(anim_p + 1) /* .startname */, ETextureType::Flat, texflags)).Exists())
continue; continue;
} }
@ -291,11 +291,11 @@ void FTextureManager::InitAnimDefs ()
{ {
if (sc.Compare ("flat")) if (sc.Compare ("flat"))
{ {
ParseAnim (sc, FTexture::TEX_Flat); ParseAnim (sc, ETextureType::Flat);
} }
else if (sc.Compare ("texture")) else if (sc.Compare ("texture"))
{ {
ParseAnim (sc, FTexture::TEX_Wall); ParseAnim (sc, ETextureType::Wall);
} }
else if (sc.Compare ("switch")) else if (sc.Compare ("switch"))
{ {
@ -317,7 +317,7 @@ void FTextureManager::InitAnimDefs ()
else if (sc.Compare("skyoffset")) else if (sc.Compare("skyoffset"))
{ {
sc.MustGetString (); sc.MustGetString ();
FTextureID picnum = CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); FTextureID picnum = CheckForTexture (sc.String, ETextureType::Wall, texflags);
sc.MustGetNumber(); sc.MustGetNumber();
if (picnum.Exists()) if (picnum.Exists())
{ {
@ -341,7 +341,7 @@ void FTextureManager::InitAnimDefs ()
// //
//========================================================================== //==========================================================================
void FTextureManager::ParseAnim (FScanner &sc, int usetype) void FTextureManager::ParseAnim (FScanner &sc, ETextureType usetype)
{ {
const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny; const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny;
TArray<FAnimDef::FAnimFrame> frames (32); TArray<FAnimDef::FAnimFrame> frames (32);
@ -463,7 +463,7 @@ void FTextureManager::ParseAnim (FScanner &sc, int usetype)
// //
//========================================================================== //==========================================================================
FAnimDef *FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing) FAnimDef *FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, ETextureType usetype, bool missing)
{ {
int type; int type;
FTextureID framenum; FTextureID framenum;
@ -504,7 +504,7 @@ FAnimDef *FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, int
// //
//========================================================================== //==========================================================================
void FTextureManager::ParsePicAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing, TArray<FAnimDef::FAnimFrame> &frames) void FTextureManager::ParsePicAnim (FScanner &sc, FTextureID picnum, ETextureType usetype, bool missing, TArray<FAnimDef::FAnimFrame> &frames)
{ {
FTextureID framenum; FTextureID framenum;
uint32_t min = 1, max = 1; uint32_t min = 1, max = 1;
@ -532,7 +532,7 @@ void FTextureManager::ParsePicAnim (FScanner &sc, FTextureID picnum, int usetype
// //
//========================================================================== //==========================================================================
FTextureID FTextureManager::ParseFramenum (FScanner &sc, FTextureID basepicnum, int usetype, bool allowMissing) FTextureID FTextureManager::ParseFramenum (FScanner &sc, FTextureID basepicnum, ETextureType usetype, bool allowMissing)
{ {
const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny; const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny;
FTextureID framenum; FTextureID framenum;
@ -611,7 +611,7 @@ void FTextureManager::ParseWarp(FScanner &sc)
{ {
sc.ScriptError (NULL); sc.ScriptError (NULL);
} }
FTextureID picnum = CheckForTexture (sc.String, isflat ? FTexture::TEX_Flat : FTexture::TEX_Wall, texflags); FTextureID picnum = CheckForTexture (sc.String, isflat ? ETextureType::Flat : ETextureType::Wall, texflags);
if (picnum.isValid()) if (picnum.isValid())
{ {
@ -675,7 +675,7 @@ void FTextureManager::ParseCameraTexture(FScanner &sc)
width = sc.Number; width = sc.Number;
sc.MustGetNumber (); sc.MustGetNumber ();
height = sc.Number; height = sc.Number;
FTextureID picnum = CheckForTexture (picname, FTexture::TEX_Flat, texflags); FTextureID picnum = CheckForTexture (picname, ETextureType::Flat, texflags);
FTexture *viewer = new FCanvasTexture (picname, width, height); FTexture *viewer = new FCanvasTexture (picname, width, height);
if (picnum.Exists()) if (picnum.Exists())
{ {
@ -690,7 +690,7 @@ void FTextureManager::ParseCameraTexture(FScanner &sc)
fitwidth = width; fitwidth = width;
fitheight = height; fitheight = height;
// [GRB] No need for oldtex // [GRB] No need for oldtex
viewer->UseType = FTexture::TEX_Wall; viewer->UseType = ETextureType::Wall;
AddTexture (viewer); AddTexture (viewer);
} }
if (sc.GetString()) if (sc.GetString())
@ -791,7 +791,7 @@ void FTextureManager::ParseAnimatedDoor(FScanner &sc)
FTextureID v; FTextureID v;
sc.MustGetString(); sc.MustGetString();
anim.BaseTexture = CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); anim.BaseTexture = CheckForTexture (sc.String, ETextureType::Wall, texflags);
if (!anim.BaseTexture.Exists()) if (!anim.BaseTexture.Exists())
{ {
@ -822,7 +822,7 @@ void FTextureManager::ParseAnimatedDoor(FScanner &sc)
} }
else else
{ {
v = CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); v = CheckForTexture (sc.String, ETextureType::Wall, texflags);
if (!v.Exists() && anim.BaseTexture.Exists() && !error) if (!v.Exists() && anim.BaseTexture.Exists() && !error)
{ {
sc.ScriptError ("Unknown texture %s", sc.String); sc.ScriptError ("Unknown texture %s", sc.String);

View File

@ -85,7 +85,7 @@ FBuildTexture::FBuildTexture(const FString &pathprefix, int tilenum, const uint8
TopOffset = top; TopOffset = top;
CalcBitSize (); CalcBitSize ();
Name.Format("%sBTIL%04d", pathprefix.GetChars(), tilenum); Name.Format("%sBTIL%04d", pathprefix.GetChars(), tilenum);
UseType = TEX_Override; UseType = ETextureType::Override;
} }
uint8_t *FBuildTexture::MakeTexture(FRenderStyle style) uint8_t *FBuildTexture::MakeTexture(FRenderStyle style)
@ -104,7 +104,7 @@ int FBuildTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, F
{ {
PalEntry *Remap = translationtables[TRANSLATION_Standard][Translation]->Palette; PalEntry *Remap = translationtables[TRANSLATION_Standard][Translation]->Palette;
bmp->CopyPixelData(x, y, RawPixels, Width, Height, Height, 1, rotate, Remap, inf); bmp->CopyPixelData(x, y, RawPixels, Width, Height, Height, 1, rotate, Remap, inf);
return 0; return -1;
} }

View File

@ -52,7 +52,7 @@ FCanvasTexture::FCanvasTexture (const char *name, int width, int height)
DummySpans[0].Length = height; DummySpans[0].Length = height;
DummySpans[1].TopOffset = 0; DummySpans[1].TopOffset = 0;
DummySpans[1].Length = 0; DummySpans[1].Length = 0;
UseType = TEX_Wall; UseType = ETextureType::Wall;
bNeedsUpdate = true; bNeedsUpdate = true;
bDidUpdate = false; bDidUpdate = false;
bHasCanvas = true; bHasCanvas = true;

View File

@ -289,7 +289,7 @@ FDDSTexture::FDDSTexture (FileReader &lump, int lumpnum, void *vsurfdesc)
{ {
DDSURFACEDESC2 *surf = (DDSURFACEDESC2 *)vsurfdesc; DDSURFACEDESC2 *surf = (DDSURFACEDESC2 *)vsurfdesc;
UseType = TEX_MiscPatch; UseType = ETextureType::MiscPatch;
LeftOffset = 0; LeftOffset = 0;
TopOffset = 0; TopOffset = 0;
bMasked = false; bMasked = false;

View File

@ -249,7 +249,7 @@ FTexture *JPEGTexture_TryCreate(FileReader & data, int lumpnum)
FJPEGTexture::FJPEGTexture (int lumpnum, int width, int height) FJPEGTexture::FJPEGTexture (int lumpnum, int width, int height)
: FWorldTexture(NULL, lumpnum) : FWorldTexture(NULL, lumpnum)
{ {
UseType = TEX_MiscPatch; UseType = ETextureType::MiscPatch;
LeftOffset = 0; LeftOffset = 0;
TopOffset = 0; TopOffset = 0;
bMasked = false; bMasked = false;

View File

@ -152,7 +152,7 @@ class FMultiPatchTexture : public FWorldTexture
{ {
public: public:
FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife, int deflump); FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife, int deflump);
FMultiPatchTexture (FScanner &sc, int usetype); FMultiPatchTexture (FScanner &sc, ETextureType usetype);
~FMultiPatchTexture (); ~FMultiPatchTexture ();
FTextureFormat GetFormat() override; FTextureFormat GetFormat() override;
@ -185,7 +185,7 @@ protected:
struct TexInit struct TexInit
{ {
FString TexName; FString TexName;
int UseType = TEX_Null; ETextureType UseType = ETextureType::Null;
bool Silent = false; bool Silent = false;
bool HasLine = false; bool HasLine = false;
bool UseOffsets = false; bool UseOffsets = false;
@ -253,7 +253,7 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
I_FatalError ("Bad texture directory"); I_FatalError ("Bad texture directory");
} }
UseType = FTexture::TEX_Wall; UseType = ETextureType::Wall;
Parts = NumParts > 0 ? new TexPart[NumParts] : nullptr; Parts = NumParts > 0 ? new TexPart[NumParts] : nullptr;
Inits = NumParts > 0 ? new TexInit[NumParts] : nullptr; Inits = NumParts > 0 ? new TexInit[NumParts] : nullptr;
Width = SAFESHORT(mtexture.d->width); Width = SAFESHORT(mtexture.d->width);
@ -289,7 +289,7 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
Parts[i].OriginY = LittleShort(mpatch.d->originy); Parts[i].OriginY = LittleShort(mpatch.d->originy);
Parts[i].Texture = nullptr; Parts[i].Texture = nullptr;
Inits[i].TexName = patchlookup[LittleShort(mpatch.d->patch)].Name; Inits[i].TexName = patchlookup[LittleShort(mpatch.d->patch)].Name;
Inits[i].UseType = TEX_WallPatch; Inits[i].UseType = ETextureType::WallPatch;
if (strife) if (strife)
mpatch.s++; mpatch.s++;
else else
@ -847,7 +847,7 @@ void FTextureManager::AddTexturesLump (const void *lumpdata, int lumpsize, int d
FMultiPatchTexture *tex = new FMultiPatchTexture ((const uint8_t *)maptex + offset, patchlookup, numpatches, isStrife, deflumpnum); FMultiPatchTexture *tex = new FMultiPatchTexture ((const uint8_t *)maptex + offset, patchlookup, numpatches, isStrife, deflumpnum);
if (i == 1 && texture1) if (i == 1 && texture1)
{ {
tex->UseType = FTexture::TEX_FirstDefined; tex->UseType = ETextureType::FirstDefined;
} }
TexMan.AddTexture (tex); TexMan.AddTexture (tex);
StartScreen->Progress(); StartScreen->Progress();
@ -1067,7 +1067,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, TexInit &init)
// //
//========================================================================== //==========================================================================
FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype) FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, ETextureType usetype)
: Pixels (0), Spans(0), Parts(0), bRedirect(false), bTranslucentPatches(false) : Pixels (0), Spans(0), Parts(0), bRedirect(false), bTranslucentPatches(false)
{ {
TArray<TexPart> parts; TArray<TexPart> parts;
@ -1123,7 +1123,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
} }
else if (sc.Compare("NullTexture")) else if (sc.Compare("NullTexture"))
{ {
UseType = FTexture::TEX_Null; UseType = ETextureType::Null;
} }
else if (sc.Compare("NoDecals")) else if (sc.Compare("NoDecals"))
{ {
@ -1137,7 +1137,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
if (init.TexName.IsNotEmpty()) if (init.TexName.IsNotEmpty())
{ {
parts.Push(part); parts.Push(part);
init.UseType = TEX_WallPatch; init.UseType = ETextureType::WallPatch;
init.Silent = bSilent; init.Silent = bSilent;
init.HasLine = true; init.HasLine = true;
init.sc = sc; init.sc = sc;
@ -1154,7 +1154,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
if (init.TexName.IsNotEmpty()) if (init.TexName.IsNotEmpty())
{ {
parts.Push(part); parts.Push(part);
init.UseType = TEX_Sprite; init.UseType = ETextureType::Sprite;
init.Silent = bSilent; init.Silent = bSilent;
init.HasLine = true; init.HasLine = true;
init.sc = sc; init.sc = sc;
@ -1171,7 +1171,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
if (init.TexName.IsNotEmpty()) if (init.TexName.IsNotEmpty())
{ {
parts.Push(part); parts.Push(part);
init.UseType = TEX_MiscPatch; init.UseType = ETextureType::MiscPatch;
init.Silent = bSilent; init.Silent = bSilent;
init.HasLine = true; init.HasLine = true;
init.sc = sc; init.sc = sc;
@ -1206,7 +1206,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
if (Width <= 0 || Height <= 0) if (Width <= 0 || Height <= 0)
{ {
UseType = FTexture::TEX_Null; UseType = ETextureType::Null;
Printf("Texture %s has invalid dimensions (%d, %d)\n", Name.GetChars(), Width, Height); Printf("Texture %s has invalid dimensions (%d, %d)\n", Name.GetChars(), Width, Height);
Width = Height = 1; Width = Height = 1;
} }
@ -1301,7 +1301,7 @@ void FMultiPatchTexture::ResolvePatches()
} }
void FTextureManager::ParseXTexture(FScanner &sc, int usetype) void FTextureManager::ParseXTexture(FScanner &sc, ETextureType usetype)
{ {
FTexture *tex = new FMultiPatchTexture(sc, usetype); FTexture *tex = new FMultiPatchTexture(sc, usetype);
TexMan.AddTexture (tex); TexMan.AddTexture (tex);

View File

@ -206,7 +206,7 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, const FString &filename
uint32_t len, id; uint32_t len, id;
int i; int i;
UseType = TEX_MiscPatch; UseType = ETextureType::MiscPatch;
LeftOffset = 0; LeftOffset = 0;
TopOffset = 0; TopOffset = 0;
bMasked = false; bMasked = false;

View File

@ -37,7 +37,7 @@
FSkyBox::FSkyBox() FSkyBox::FSkyBox()
{ {
faces[0]=faces[1]=faces[2]=faces[3]=faces[4]=faces[5]=NULL; faces[0]=faces[1]=faces[2]=faces[3]=faces[4]=faces[5]=NULL;
UseType=TEX_Override; UseType = ETextureType::Override;
gl_info.bSkybox = true; gl_info.bSkybox = true;
fliptop = false; fliptop = false;
} }
@ -136,7 +136,7 @@ void ParseGldefSkybox(FScanner &sc)
sc.MustGetString(); sc.MustGetString();
if (facecount<6) if (facecount<6)
{ {
sb->faces[facecount] = TexMan[TexMan.GetTexture(sc.String, FTexture::TEX_Wall, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_Overridable)]; sb->faces[facecount] = TexMan[TexMan.GetTexture(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_Overridable)];
} }
facecount++; facecount++;
} }
@ -181,7 +181,7 @@ void ParseVavoomSkybox()
maplump = Wads.CheckNumForFullName(sc.String, true); maplump = Wads.CheckNumForFullName(sc.String, true);
FTexture *tex = TexMan.FindTexture(sc.String, FTexture::TEX_Wall, FTextureManager::TEXMAN_TryAny); FTexture *tex = TexMan.FindTexture(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny);
if (tex == NULL) if (tex == NULL)
{ {
sc.ScriptMessage("Texture '%s' not found in Vavoom skybox '%s'\n", sc.String, sb->Name.GetChars()); sc.ScriptMessage("Texture '%s' not found in Vavoom skybox '%s'\n", sc.String, sb->Name.GetChars());

View File

@ -52,7 +52,7 @@ typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum);
struct TexCreateInfo struct TexCreateInfo
{ {
CreateFunc TryCreate; CreateFunc TryCreate;
int usetype; ETextureType usetype;
}; };
uint8_t FTexture::GrayMap[256]; uint8_t FTexture::GrayMap[256];
@ -80,20 +80,20 @@ FTexture *AutomapTexture_TryCreate(FileReader &, int lumpnum);
// Examines the lump contents to decide what type of texture to create, // Examines the lump contents to decide what type of texture to create,
// and creates the texture. // and creates the texture.
FTexture * FTexture::CreateTexture (int lumpnum, int usetype) FTexture * FTexture::CreateTexture (int lumpnum, ETextureType usetype)
{ {
static TexCreateInfo CreateInfo[]={ static TexCreateInfo CreateInfo[]={
{ IMGZTexture_TryCreate, TEX_Any }, { IMGZTexture_TryCreate, ETextureType::Any },
{ PNGTexture_TryCreate, TEX_Any }, { PNGTexture_TryCreate, ETextureType::Any },
{ JPEGTexture_TryCreate, TEX_Any }, { JPEGTexture_TryCreate, ETextureType::Any },
{ DDSTexture_TryCreate, TEX_Any }, { DDSTexture_TryCreate, ETextureType::Any },
{ PCXTexture_TryCreate, TEX_Any }, { PCXTexture_TryCreate, ETextureType::Any },
{ TGATexture_TryCreate, TEX_Any }, { TGATexture_TryCreate, ETextureType::Any },
{ RawPageTexture_TryCreate, TEX_MiscPatch }, { RawPageTexture_TryCreate, ETextureType::MiscPatch },
{ FlatTexture_TryCreate, TEX_Flat }, { FlatTexture_TryCreate, ETextureType::Flat },
{ PatchTexture_TryCreate, TEX_Any }, { PatchTexture_TryCreate, ETextureType::Any },
{ EmptyTexture_TryCreate, TEX_Any }, { EmptyTexture_TryCreate, ETextureType::Any },
{ AutomapTexture_TryCreate, TEX_MiscPatch }, { AutomapTexture_TryCreate, ETextureType::MiscPatch },
}; };
if (lumpnum == -1) return NULL; if (lumpnum == -1) return NULL;
@ -102,13 +102,13 @@ FTexture * FTexture::CreateTexture (int lumpnum, int usetype)
for(size_t i = 0; i < countof(CreateInfo); i++) for(size_t i = 0; i < countof(CreateInfo); i++)
{ {
if ((CreateInfo[i].usetype == usetype || CreateInfo[i].usetype == TEX_Any)) if ((CreateInfo[i].usetype == usetype || CreateInfo[i].usetype == ETextureType::Any))
{ {
FTexture * tex = CreateInfo[i].TryCreate(data, lumpnum); FTexture * tex = CreateInfo[i].TryCreate(data, lumpnum);
if (tex != NULL) if (tex != NULL)
{ {
tex->UseType = usetype; tex->UseType = usetype;
if (usetype == FTexture::TEX_Flat) if (usetype == ETextureType::Flat)
{ {
int w = tex->GetWidth(); int w = tex->GetWidth();
int h = tex->GetHeight(); int h = tex->GetHeight();
@ -134,7 +134,7 @@ FTexture * FTexture::CreateTexture (int lumpnum, int usetype)
return NULL; return NULL;
} }
FTexture * FTexture::CreateTexture (const char *name, int lumpnum, int usetype) FTexture * FTexture::CreateTexture (const char *name, int lumpnum, ETextureType usetype)
{ {
FTexture *tex = CreateTexture(lumpnum, usetype); FTexture *tex = CreateTexture(lumpnum, usetype);
if (tex != NULL && name != NULL) { if (tex != NULL && name != NULL) {
@ -148,7 +148,7 @@ FTexture * FTexture::CreateTexture (const char *name, int lumpnum, int usetype)
FTexture::FTexture (const char *name, int lumpnum) FTexture::FTexture (const char *name, int lumpnum)
: LeftOffset(0), TopOffset(0), : LeftOffset(0), TopOffset(0),
WidthBits(0), HeightBits(0), Scale(1,1), SourceLump(lumpnum), WidthBits(0), HeightBits(0), Scale(1,1), SourceLump(lumpnum),
UseType(TEX_Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false), UseType(ETextureType::Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false),
bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false), bKeepAround(false), bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false), bKeepAround(false),
Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0), WidthMask(0) Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0), WidthMask(0)
{ {
@ -949,7 +949,7 @@ FDummyTexture::FDummyTexture ()
HeightBits = 6; HeightBits = 6;
WidthBits = 6; WidthBits = 6;
WidthMask = 63; WidthMask = 63;
UseType = TEX_Null; UseType = ETextureType::Null;
} }
void FDummyTexture::SetSize (int width, int height) void FDummyTexture::SetSize (int width, int height)
@ -983,7 +983,7 @@ CCMD (printspans)
if (argv.argc() != 2) if (argv.argc() != 2)
return; return;
FTextureID picnum = TexMan.CheckForTexture (argv[1], FTexture::TEX_Any); FTextureID picnum = TexMan.CheckForTexture (argv[1], ETextureType::Any);
if (!picnum.Exists()) if (!picnum.Exists())
{ {
Printf ("Unknown texture %s\n", argv[1]); Printf ("Unknown texture %s\n", argv[1]);

View File

@ -146,11 +146,11 @@ void FTextureManager::DeleteAll()
// //
//========================================================================== //==========================================================================
FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITFIELD flags) FTextureID FTextureManager::CheckForTexture (const char *name, ETextureType usetype, BITFIELD flags)
{ {
int i; int i;
int firstfound = -1; int firstfound = -1;
int firsttype = FTexture::TEX_Null; auto firsttype = ETextureType::Null;
if (name == NULL || name[0] == '\0') if (name == NULL || name[0] == '\0')
{ {
@ -172,14 +172,14 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
if (stricmp (tex->Name, name) == 0) if (stricmp (tex->Name, name) == 0)
{ {
// The name matches, so check the texture type // The name matches, so check the texture type
if (usetype == FTexture::TEX_Any) if (usetype == ETextureType::Any)
{ {
// All NULL textures should actually return 0 // All NULL textures should actually return 0
if (tex->UseType == FTexture::TEX_FirstDefined && !(flags & TEXMAN_ReturnFirst)) return 0; if (tex->UseType == ETextureType::FirstDefined && !(flags & TEXMAN_ReturnFirst)) return 0;
if (tex->UseType == FTexture::TEX_SkinGraphic && !(flags & TEXMAN_AllowSkins)) return 0; if (tex->UseType == ETextureType::SkinGraphic && !(flags & TEXMAN_AllowSkins)) return 0;
return FTextureID(tex->UseType==FTexture::TEX_Null ? 0 : i); return FTextureID(tex->UseType==ETextureType::Null ? 0 : i);
} }
else if ((flags & TEXMAN_Overridable) && tex->UseType == FTexture::TEX_Override) else if ((flags & TEXMAN_Overridable) && tex->UseType == ETextureType::Override)
{ {
return FTextureID(i); return FTextureID(i);
} }
@ -187,22 +187,22 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
{ {
return FTextureID(i); return FTextureID(i);
} }
else if (tex->UseType == FTexture::TEX_FirstDefined && usetype == FTexture::TEX_Wall) else if (tex->UseType == ETextureType::FirstDefined && usetype == ETextureType::Wall)
{ {
if (!(flags & TEXMAN_ReturnFirst)) return FTextureID(0); if (!(flags & TEXMAN_ReturnFirst)) return FTextureID(0);
else return FTextureID(i); else return FTextureID(i);
} }
else if (tex->UseType == FTexture::TEX_Null && usetype == FTexture::TEX_Wall) else if (tex->UseType == ETextureType::Null && usetype == ETextureType::Wall)
{ {
// We found a NULL texture on a wall -> return 0 // We found a NULL texture on a wall -> return 0
return FTextureID(0); return FTextureID(0);
} }
else else
{ {
if (firsttype == FTexture::TEX_Null || if (firsttype == ETextureType::Null ||
(firsttype == FTexture::TEX_MiscPatch && (firsttype == ETextureType::MiscPatch &&
tex->UseType != firsttype && tex->UseType != firsttype &&
tex->UseType != FTexture::TEX_Null) tex->UseType != ETextureType::Null)
) )
{ {
firstfound = i; firstfound = i;
@ -213,13 +213,13 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
i = Textures[i].HashNext; i = Textures[i].HashNext;
} }
if ((flags & TEXMAN_TryAny) && usetype != FTexture::TEX_Any) if ((flags & TEXMAN_TryAny) && usetype != ETextureType::Any)
{ {
// Never return the index of NULL textures. // Never return the index of NULL textures.
if (firstfound != -1) if (firstfound != -1)
{ {
if (firsttype == FTexture::TEX_Null) return FTextureID(0); if (firsttype == ETextureType::Null) return FTextureID(0);
if (firsttype == FTexture::TEX_FirstDefined && !(flags & TEXMAN_ReturnFirst)) return FTextureID(0); if (firsttype == ETextureType::FirstDefined && !(flags & TEXMAN_ReturnFirst)) return FTextureID(0);
return FTextureID(firstfound); return FTextureID(firstfound);
} }
} }
@ -239,7 +239,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
if (tex == NO_TEXTURE) return FTextureID(-1); if (tex == NO_TEXTURE) return FTextureID(-1);
if (tex != NULL) return tex->id; if (tex != NULL) return tex->id;
if (flags & TEXMAN_DontCreate) return FTextureID(-1); // we only want to check, there's no need to create a texture if we don't have one yet. if (flags & TEXMAN_DontCreate) return FTextureID(-1); // we only want to check, there's no need to create a texture if we don't have one yet.
tex = FTexture::CreateTexture("", lump, FTexture::TEX_Override); tex = FTexture::CreateTexture("", lump, ETextureType::Override);
if (tex != NULL) if (tex != NULL)
{ {
Wads.SetLinkedTexture(lump, tex); Wads.SetLinkedTexture(lump, tex);
@ -263,7 +263,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, CheckForTexture)
PARAM_STRING(name); PARAM_STRING(name);
PARAM_INT(type); PARAM_INT(type);
PARAM_INT_DEF(flags); PARAM_INT_DEF(flags);
ACTION_RETURN_INT(TexMan.CheckForTexture(name, type, flags).GetIndex()); ACTION_RETURN_INT(TexMan.CheckForTexture(name, static_cast<ETextureType>(type), flags).GetIndex());
} }
//========================================================================== //==========================================================================
@ -296,7 +296,7 @@ int FTextureManager::ListTextures (const char *name, TArray<FTextureID> &list, b
if (stricmp (tex->Name, name) == 0) if (stricmp (tex->Name, name) == 0)
{ {
// NULL textures must be ignored. // NULL textures must be ignored.
if (tex->UseType!=FTexture::TEX_Null) if (tex->UseType!=ETextureType::Null)
{ {
unsigned int j = list.Size(); unsigned int j = list.Size();
if (!listall) if (!listall)
@ -321,7 +321,7 @@ int FTextureManager::ListTextures (const char *name, TArray<FTextureID> &list, b
// //
//========================================================================== //==========================================================================
FTextureID FTextureManager::GetTexture (const char *name, int usetype, BITFIELD flags) FTextureID FTextureManager::GetTexture (const char *name, ETextureType usetype, BITFIELD flags)
{ {
FTextureID i; FTextureID i;
@ -349,7 +349,7 @@ FTextureID FTextureManager::GetTexture (const char *name, int usetype, BITFIELD
// //
//========================================================================== //==========================================================================
FTexture *FTextureManager::FindTexture(const char *texname, int usetype, BITFIELD flags) FTexture *FTextureManager::FindTexture(const char *texname, ETextureType usetype, BITFIELD flags)
{ {
FTextureID texnum = CheckForTexture (texname, usetype, flags); FTextureID texnum = CheckForTexture (texname, usetype, flags);
return !texnum.isValid()? NULL : Textures[texnum.GetIndex()].Texture; return !texnum.isValid()? NULL : Textures[texnum.GetIndex()].Texture;
@ -411,7 +411,7 @@ FTextureID FTextureManager::AddTexture (FTexture *texture)
// //
//========================================================================== //==========================================================================
FTextureID FTextureManager::CreateTexture (int lumpnum, int usetype) FTextureID FTextureManager::CreateTexture (int lumpnum, ETextureType usetype)
{ {
if (lumpnum != -1) if (lumpnum != -1)
{ {
@ -496,7 +496,7 @@ bool FTextureManager::AreTexturesCompatible (FTextureID picnum1, FTextureID picn
// //
//========================================================================== //==========================================================================
void FTextureManager::AddGroup(int wadnum, int ns, int usetype) void FTextureManager::AddGroup(int wadnum, int ns, ETextureType usetype)
{ {
int firsttx = Wads.GetFirstLump(wadnum); int firsttx = Wads.GetFirstLump(wadnum);
int lasttx = Wads.GetLastLump(wadnum); int lasttx = Wads.GetLastLump(wadnum);
@ -562,10 +562,10 @@ void FTextureManager::AddHiresTextures (int wadnum)
if (amount == 0) if (amount == 0)
{ {
// A texture with this name does not yet exist // A texture with this name does not yet exist
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any); FTexture * newtex = FTexture::CreateTexture (firsttx, ETextureType::Any);
if (newtex != NULL) if (newtex != NULL)
{ {
newtex->UseType=FTexture::TEX_Override; newtex->UseType=ETextureType::Override;
AddTexture(newtex); AddTexture(newtex);
} }
} }
@ -573,7 +573,7 @@ void FTextureManager::AddHiresTextures (int wadnum)
{ {
for(unsigned int i = 0; i < tlist.Size(); i++) for(unsigned int i = 0; i < tlist.Size(); i++)
{ {
FTexture * newtex = FTexture::CreateTexture (firsttx, FTexture::TEX_Any); FTexture * newtex = FTexture::CreateTexture (firsttx, ETextureType::Any);
if (newtex != NULL) if (newtex != NULL)
{ {
FTexture * oldtex = Textures[tlist[i].GetIndex()].Texture; FTexture * oldtex = Textures[tlist[i].GetIndex()].Texture;
@ -605,7 +605,8 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
FString src; FString src;
bool is32bit; bool is32bit;
int width, height; int width, height;
int type, mode; ETextureType type;
int mode;
TArray<FTextureID> tlist; TArray<FTextureID> tlist;
lastLump = 0; lastLump = 0;
@ -622,12 +623,12 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
sc.MustGetString(); sc.MustGetString();
// allow selection by type // allow selection by type
if (sc.Compare("wall")) type=FTexture::TEX_Wall, mode=FTextureManager::TEXMAN_Overridable; if (sc.Compare("wall")) type=ETextureType::Wall, mode=FTextureManager::TEXMAN_Overridable;
else if (sc.Compare("flat")) type=FTexture::TEX_Flat, mode=FTextureManager::TEXMAN_Overridable; else if (sc.Compare("flat")) type=ETextureType::Flat, mode=FTextureManager::TEXMAN_Overridable;
else if (sc.Compare("sprite")) type=FTexture::TEX_Sprite, mode=0; else if (sc.Compare("sprite")) type=ETextureType::Sprite, mode=0;
else type = FTexture::TEX_Any, mode = 0; else type = ETextureType::Any, mode = 0;
if (type != FTexture::TEX_Any) sc.MustGetString(); if (type != ETextureType::Any) sc.MustGetString();
sc.String[8]=0; sc.String[8]=0;
@ -658,13 +659,13 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
// only replace matching types. For sprites also replace any MiscPatches // only replace matching types. For sprites also replace any MiscPatches
// based on the same lump. These can be created for icons. // based on the same lump. These can be created for icons.
if (oldtex->UseType == type || type == FTexture::TEX_Any || if (oldtex->UseType == type || type == ETextureType::Any ||
(mode == TEXMAN_Overridable && oldtex->UseType == FTexture::TEX_Override) || (mode == TEXMAN_Overridable && oldtex->UseType == ETextureType::Override) ||
(type == FTexture::TEX_Sprite && oldtex->UseType == FTexture::TEX_MiscPatch && (type == ETextureType::Sprite && oldtex->UseType == ETextureType::MiscPatch &&
(sl=oldtex->GetSourceLump()) >= 0 && Wads.GetLumpNamespace(sl) == ns_sprites) (sl=oldtex->GetSourceLump()) >= 0 && Wads.GetLumpNamespace(sl) == ns_sprites)
) )
{ {
FTexture * newtex = FTexture::CreateTexture (lumpnum, FTexture::TEX_Any); FTexture * newtex = FTexture::CreateTexture (lumpnum, ETextureType::Any);
if (newtex != NULL) if (newtex != NULL)
{ {
// Replace the entire texture and adjust the scaling and offset factors. // Replace the entire texture and adjust the scaling and offset factors.
@ -701,7 +702,7 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
if (lumpnum>=0) if (lumpnum>=0)
{ {
FTexture *newtex = FTexture::CreateTexture(lumpnum, FTexture::TEX_Override); FTexture *newtex = FTexture::CreateTexture(lumpnum, ETextureType::Override);
if (newtex != NULL) if (newtex != NULL)
{ {
@ -710,11 +711,11 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
newtex->SetScaledSize(width, height); newtex->SetScaledSize(width, height);
newtex->Name = src; newtex->Name = src;
FTextureID oldtex = TexMan.CheckForTexture(src, FTexture::TEX_MiscPatch); FTextureID oldtex = TexMan.CheckForTexture(src, ETextureType::MiscPatch);
if (oldtex.isValid()) if (oldtex.isValid())
{ {
ReplaceTexture(oldtex, newtex, true); ReplaceTexture(oldtex, newtex, true);
newtex->UseType = FTexture::TEX_Override; newtex->UseType = ETextureType::Override;
} }
else AddTexture(newtex); else AddTexture(newtex);
} }
@ -724,23 +725,23 @@ void FTextureManager::LoadTextureDefs(int wadnum, const char *lumpname)
} }
else if (sc.Compare("texture")) else if (sc.Compare("texture"))
{ {
ParseXTexture(sc, FTexture::TEX_Override); ParseXTexture(sc, ETextureType::Override);
} }
else if (sc.Compare("sprite")) else if (sc.Compare("sprite"))
{ {
ParseXTexture(sc, FTexture::TEX_Sprite); ParseXTexture(sc, ETextureType::Sprite);
} }
else if (sc.Compare("walltexture")) else if (sc.Compare("walltexture"))
{ {
ParseXTexture(sc, FTexture::TEX_Wall); ParseXTexture(sc, ETextureType::Wall);
} }
else if (sc.Compare("flat")) else if (sc.Compare("flat"))
{ {
ParseXTexture(sc, FTexture::TEX_Flat); ParseXTexture(sc, ETextureType::Flat);
} }
else if (sc.Compare("graphic")) else if (sc.Compare("graphic"))
{ {
ParseXTexture(sc, FTexture::TEX_MiscPatch); ParseXTexture(sc, ETextureType::MiscPatch);
} }
else else
{ {
@ -770,9 +771,9 @@ void FTextureManager::AddPatches (int lumpnum)
{ {
file.Read (name, 8); file.Read (name, 8);
if (CheckForTexture (name, FTexture::TEX_WallPatch, 0) == -1) if (CheckForTexture (name, ETextureType::WallPatch, 0) == -1)
{ {
CreateTexture (Wads.CheckNumForName (name, ns_patches), FTexture::TEX_WallPatch); CreateTexture (Wads.CheckNumForName (name, ns_patches), ETextureType::WallPatch);
} }
StartScreen->Progress(); StartScreen->Progress();
} }
@ -822,20 +823,20 @@ void FTextureManager::AddTexturesForWad(int wadnum)
FirstTextureForFile.Push(firsttexture); FirstTextureForFile.Push(firsttexture);
// First step: Load sprites // First step: Load sprites
AddGroup(wadnum, ns_sprites, FTexture::TEX_Sprite); AddGroup(wadnum, ns_sprites, ETextureType::Sprite);
// When loading a Zip, all graphics in the patches/ directory should be // When loading a Zip, all graphics in the patches/ directory should be
// added as well. // added as well.
AddGroup(wadnum, ns_patches, FTexture::TEX_WallPatch); AddGroup(wadnum, ns_patches, ETextureType::WallPatch);
// Second step: TEXTUREx lumps // Second step: TEXTUREx lumps
LoadTextureX(wadnum); LoadTextureX(wadnum);
// Third step: Flats // Third step: Flats
AddGroup(wadnum, ns_flats, FTexture::TEX_Flat); AddGroup(wadnum, ns_flats, ETextureType::Flat);
// Fourth step: Textures (TX_) // Fourth step: Textures (TX_)
AddGroup(wadnum, ns_newtextures, FTexture::TEX_Override); AddGroup(wadnum, ns_newtextures, ETextureType::Override);
// Sixth step: Try to find any lump in the WAD that may be a texture and load as a TEX_MiscPatch // Sixth step: Try to find any lump in the WAD that may be a texture and load as a TEX_MiscPatch
int firsttx = Wads.GetFirstLump(wadnum); int firsttx = Wads.GetFirstLump(wadnum);
@ -874,7 +875,7 @@ void FTextureManager::AddTexturesForWad(int wadnum)
if (Wads.CheckNumForName(Name, ns_graphics) != i) continue; if (Wads.CheckNumForName(Name, ns_graphics) != i) continue;
// skip this if it has already been added as a wall patch. // skip this if it has already been added as a wall patch.
if (CheckForTexture(Name, FTexture::TEX_WallPatch, 0).Exists()) continue; if (CheckForTexture(Name, ETextureType::WallPatch, 0).Exists()) continue;
} }
else if (ns == ns_graphics) else if (ns == ns_graphics)
{ {
@ -891,7 +892,7 @@ void FTextureManager::AddTexturesForWad(int wadnum)
// Try to create a texture from this lump and add it. // Try to create a texture from this lump and add it.
// Unfortunately we have to look at everything that comes through here... // Unfortunately we have to look at everything that comes through here...
FTexture *out = FTexture::CreateTexture(i, skin ? FTexture::TEX_SkinGraphic : FTexture::TEX_MiscPatch); FTexture *out = FTexture::CreateTexture(i, skin ? ETextureType::SkinGraphic : ETextureType::MiscPatch);
if (out != NULL) if (out != NULL)
{ {
@ -937,10 +938,10 @@ void FTextureManager::SortTexturesByType(int start, int end)
Textures.Resize(start); Textures.Resize(start);
Translation.Resize(start); Translation.Resize(start);
static int texturetypes[] = { static ETextureType texturetypes[] = {
FTexture::TEX_Sprite, FTexture::TEX_Null, FTexture::TEX_FirstDefined, ETextureType::Sprite, ETextureType::Null, ETextureType::FirstDefined,
FTexture::TEX_WallPatch, FTexture::TEX_Wall, FTexture::TEX_Flat, ETextureType::WallPatch, ETextureType::Wall, ETextureType::Flat,
FTexture::TEX_Override, FTexture::TEX_MiscPatch, FTexture::TEX_SkinGraphic ETextureType::Override, ETextureType::MiscPatch, ETextureType::SkinGraphic
}; };
for(unsigned int i=0;i<countof(texturetypes);i++) for(unsigned int i=0;i<countof(texturetypes);i++)
@ -1005,14 +1006,14 @@ void FTextureManager::Init()
InitBuildTiles (); InitBuildTiles ();
FirstTextureForFile.Push(Textures.Size()); FirstTextureForFile.Push(Textures.Size());
DefaultTexture = CheckForTexture ("-NOFLAT-", FTexture::TEX_Override, 0); DefaultTexture = CheckForTexture ("-NOFLAT-", ETextureType::Override, 0);
// The Hexen scripts use BLANK as a blank texture, even though it's really not. // The Hexen scripts use BLANK as a blank texture, even though it's really not.
// I guess the Doom renderer must have clipped away the line at the bottom of // I guess the Doom renderer must have clipped away the line at the bottom of
// the texture so it wasn't visible. I'll just map it to 0, so it really is blank. // the texture so it wasn't visible. I'll just map it to 0, so it really is blank.
if (gameinfo.gametype == GAME_Hexen) if (gameinfo.gametype == GAME_Hexen)
{ {
FTextureID tex = CheckForTexture ("BLANK", FTexture::TEX_Wall, false); FTextureID tex = CheckForTexture ("BLANK", ETextureType::Wall, false);
if (tex.Exists()) if (tex.Exists())
{ {
SetTranslation (tex, 0); SetTranslation (tex, 0);
@ -1026,7 +1027,7 @@ void FTextureManager::Init()
{ {
if (wadlevelinfos[i].flags & LEVEL_DOUBLESKY) if (wadlevelinfos[i].flags & LEVEL_DOUBLESKY)
{ {
FTextureID picnum = CheckForTexture (wadlevelinfos[i].SkyPic1, FTexture::TEX_Wall, false); FTextureID picnum = CheckForTexture (wadlevelinfos[i].SkyPic1, ETextureType::Wall, false);
if (picnum.isValid()) if (picnum.isValid())
{ {
Textures[picnum.GetIndex()].Texture->SetFrontSkyLayer (); Textures[picnum.GetIndex()].Texture->SetFrontSkyLayer ();
@ -1058,13 +1059,13 @@ void FTextureManager::InitPalettedVersions()
while (sc.GetString()) while (sc.GetString())
{ {
FTextureID pic1 = CheckForTexture(sc.String, FTexture::TEX_Any); FTextureID pic1 = CheckForTexture(sc.String, ETextureType::Any);
if (!pic1.isValid()) if (!pic1.isValid())
{ {
sc.ScriptMessage("Unknown texture %s to replace", sc.String); sc.ScriptMessage("Unknown texture %s to replace", sc.String);
} }
sc.MustGetString(); sc.MustGetString();
FTextureID pic2 = CheckForTexture(sc.String, FTexture::TEX_Any); FTextureID pic2 = CheckForTexture(sc.String, ETextureType::Any);
if (!pic2.isValid()) if (!pic2.isValid())
{ {
sc.ScriptMessage("Unknown texture %s to use as replacement", sc.String); sc.ScriptMessage("Unknown texture %s to use as replacement", sc.String);

View File

@ -177,8 +177,8 @@ class FNativeTexture;
class FTexture class FTexture
{ {
public: public:
static FTexture *CreateTexture(const char *name, int lumpnum, int usetype); static FTexture *CreateTexture(const char *name, int lumpnum, ETextureType usetype);
static FTexture *CreateTexture(int lumpnum, int usetype); static FTexture *CreateTexture(int lumpnum, ETextureType usetype);
virtual ~FTexture (); virtual ~FTexture ();
int16_t LeftOffset, TopOffset; int16_t LeftOffset, TopOffset;
@ -191,7 +191,7 @@ public:
FTextureID id; FTextureID id;
FString Name; FString Name;
uint8_t UseType; // This texture's primary purpose ETextureType UseType; // This texture's primary purpose
uint8_t bNoDecals:1; // Decals should not stick to texture uint8_t bNoDecals:1; // Decals should not stick to texture
uint8_t bNoRemap0:1; // Do not remap color 0 (used by front layer of parallax skies) uint8_t bNoRemap0:1; // Do not remap color 0 (used by front layer of parallax skies)
@ -209,24 +209,6 @@ public:
uint16_t Rotations; uint16_t Rotations;
int16_t SkyOffset; int16_t SkyOffset;
enum // UseTypes
{
TEX_Any,
TEX_Wall,
TEX_Flat,
TEX_Sprite,
TEX_WallPatch,
TEX_Build, // no longer used but needs to remain for ZScript
TEX_SkinSprite,
TEX_Decal,
TEX_MiscPatch,
TEX_FontChar,
TEX_Override, // For patches between TX_START/TX_END
TEX_Autopage, // Automap background - used to enable the use of FAutomapTexture
TEX_SkinGraphic,
TEX_Null,
TEX_FirstDefined,
};
struct Span struct Span
{ {
@ -464,6 +446,7 @@ public:
~FTextureManager (); ~FTextureManager ();
// Get texture without translation // Get texture without translation
//private:
FTexture *operator[] (FTextureID texnum) FTexture *operator[] (FTextureID texnum)
{ {
if ((unsigned)texnum.GetIndex() >= Textures.Size()) return NULL; if ((unsigned)texnum.GetIndex() >= Textures.Size()) return NULL;
@ -471,7 +454,7 @@ public:
} }
FTexture *operator[] (const char *texname) FTexture *operator[] (const char *texname)
{ {
FTextureID texnum = GetTexture (texname, FTexture::TEX_MiscPatch); FTextureID texnum = GetTexture (texname, ETextureType::MiscPatch);
if (!texnum.Exists()) return NULL; if (!texnum.Exists()) return NULL;
return Textures[texnum.GetIndex()].Texture; return Textures[texnum.GetIndex()].Texture;
} }
@ -480,7 +463,7 @@ public:
if (unsigned(i) >= Textures.Size()) return NULL; if (unsigned(i) >= Textures.Size()) return NULL;
return Textures[i].Texture; return Textures[i].Texture;
} }
FTexture *FindTexture(const char *texname, int usetype = FTexture::TEX_MiscPatch, BITFIELD flags = TEXMAN_TryAny); FTexture *FindTexture(const char *texname, ETextureType usetype = ETextureType::MiscPatch, BITFIELD flags = TEXMAN_TryAny);
// Get texture with translation // Get texture with translation
FTexture *operator() (FTextureID texnum, bool withpalcheck=false) FTexture *operator() (FTextureID texnum, bool withpalcheck=false)
@ -495,7 +478,7 @@ public:
} }
FTexture *operator() (const char *texname) FTexture *operator() (const char *texname)
{ {
FTextureID texnum = GetTexture (texname, FTexture::TEX_MiscPatch); FTextureID texnum = GetTexture (texname, ETextureType::MiscPatch);
if (texnum.texnum == -1) return NULL; if (texnum.texnum == -1) return NULL;
return Textures[Translation[texnum.texnum]].Texture; return Textures[Translation[texnum.texnum]].Texture;
} }
@ -505,6 +488,7 @@ public:
if (unsigned(i) >= Textures.Size()) return NULL; if (unsigned(i) >= Textures.Size()) return NULL;
return Textures[Translation[i]].Texture; return Textures[Translation[i]].Texture;
} }
//public:
FTextureID PalCheck(FTextureID tex); FTextureID PalCheck(FTextureID tex);
@ -528,21 +512,21 @@ public:
HIT_Columnmode = HIT_Wall|HIT_Sky|HIT_Sprite HIT_Columnmode = HIT_Wall|HIT_Sky|HIT_Sprite
}; };
FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny); FTextureID CheckForTexture (const char *name, ETextureType usetype, BITFIELD flags=TEXMAN_TryAny);
FTextureID GetTexture (const char *name, int usetype, BITFIELD flags=0); FTextureID GetTexture (const char *name, ETextureType usetype, BITFIELD flags=0);
int ListTextures (const char *name, TArray<FTextureID> &list, bool listall = false); int ListTextures (const char *name, TArray<FTextureID> &list, bool listall = false);
void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false); void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false);
void AddTexturesLumps (int lump1, int lump2, int patcheslump); void AddTexturesLumps (int lump1, int lump2, int patcheslump);
void AddGroup(int wadnum, int ns, int usetype); void AddGroup(int wadnum, int ns, ETextureType usetype);
void AddPatches (int lumpnum); void AddPatches (int lumpnum);
void AddHiresTextures (int wadnum); void AddHiresTextures (int wadnum);
void LoadTextureDefs(int wadnum, const char *lumpname); void LoadTextureDefs(int wadnum, const char *lumpname);
void ParseXTexture(FScanner &sc, int usetype); void ParseXTexture(FScanner &sc, ETextureType usetype);
void SortTexturesByType(int start, int end); void SortTexturesByType(int start, int end);
bool AreTexturesCompatible (FTextureID picnum1, FTextureID picnum2); bool AreTexturesCompatible (FTextureID picnum1, FTextureID picnum2);
FTextureID CreateTexture (int lumpnum, int usetype=FTexture::TEX_Any); // Also calls AddTexture FTextureID CreateTexture (int lumpnum, ETextureType usetype=ETextureType::Any); // Also calls AddTexture
FTextureID AddTexture (FTexture *texture); FTextureID AddTexture (FTexture *texture);
FTextureID GetDefaultTexture() const { return DefaultTexture; } FTextureID GetDefaultTexture() const { return DefaultTexture; }
@ -588,12 +572,12 @@ private:
void InitAnimDefs (); void InitAnimDefs ();
FAnimDef *AddSimpleAnim (FTextureID picnum, int animcount, uint32_t speedmin, uint32_t speedrange=0); FAnimDef *AddSimpleAnim (FTextureID picnum, int animcount, uint32_t speedmin, uint32_t speedrange=0);
FAnimDef *AddComplexAnim (FTextureID picnum, const TArray<FAnimDef::FAnimFrame> &frames); FAnimDef *AddComplexAnim (FTextureID picnum, const TArray<FAnimDef::FAnimFrame> &frames);
void ParseAnim (FScanner &sc, int usetype); void ParseAnim (FScanner &sc, ETextureType usetype);
FAnimDef *ParseRangeAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing); FAnimDef *ParseRangeAnim (FScanner &sc, FTextureID picnum, ETextureType usetype, bool missing);
void ParsePicAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing, TArray<FAnimDef::FAnimFrame> &frames); void ParsePicAnim (FScanner &sc, FTextureID picnum, ETextureType usetype, bool missing, TArray<FAnimDef::FAnimFrame> &frames);
void ParseWarp(FScanner &sc); void ParseWarp(FScanner &sc);
void ParseCameraTexture(FScanner &sc); void ParseCameraTexture(FScanner &sc);
FTextureID ParseFramenum (FScanner &sc, FTextureID basepicnum, int usetype, bool allowMissing); FTextureID ParseFramenum (FScanner &sc, FTextureID basepicnum, ETextureType usetype, bool allowMissing);
void ParseTime (FScanner &sc, uint32_t &min, uint32_t &max); void ParseTime (FScanner &sc, uint32_t &min, uint32_t &max);
FTexture *Texture(FTextureID id) { return Textures[id.GetIndex()].Texture; } FTexture *Texture(FTextureID id) { return Textures[id.GetIndex()].Texture; }
void SetTranslation (FTextureID fromtexnum, FTextureID totexnum); void SetTranslation (FTextureID fromtexnum, FTextureID totexnum);

View File

@ -48,14 +48,14 @@ FImageCollection::FImageCollection (const char **patchNames, int numPatches)
Add (patchNames, numPatches); Add (patchNames, numPatches);
} }
void FImageCollection::Init (const char **patchNames, int numPatches, int namespc) void FImageCollection::Init (const char **patchNames, int numPatches, ETextureType namespc)
{ {
ImageMap.Clear(); ImageMap.Clear();
Add(patchNames, numPatches, namespc); Add(patchNames, numPatches, namespc);
} }
// [MH] Mainly for mugshots with skins and SBARINFO // [MH] Mainly for mugshots with skins and SBARINFO
void FImageCollection::Add (const char **patchNames, int numPatches, int namespc) void FImageCollection::Add (const char **patchNames, int numPatches, ETextureType namespc)
{ {
int OldCount = ImageMap.Size(); int OldCount = ImageMap.Size();
@ -64,14 +64,6 @@ void FImageCollection::Add (const char **patchNames, int numPatches, int namespc
for (int i = 0; i < numPatches; ++i) for (int i = 0; i < numPatches; ++i)
{ {
FTextureID picnum = TexMan.CheckForTexture(patchNames[i], namespc); FTextureID picnum = TexMan.CheckForTexture(patchNames[i], namespc);
if (!picnum.isValid())
{
int lumpnum = Wads.CheckNumForName(patchNames[i], namespc);
if (lumpnum >= 0)
{
picnum = TexMan.CreateTexture(lumpnum, namespc);
}
}
ImageMap[OldCount + i] = picnum; ImageMap[OldCount + i] = picnum;
} }
} }

View File

@ -45,8 +45,8 @@ public:
FImageCollection(); FImageCollection();
FImageCollection(const char **patchNames, int numPatches); FImageCollection(const char **patchNames, int numPatches);
void Init (const char **patchnames, int numPatches, int namespc=0); void Init(const char **patchnames, int numPatches, ETextureType namespc = ETextureType::Any);
void Add (const char **patchnames, int numPatches, int namespc=0); void Add(const char **patchnames, int numPatches, ETextureType namespc = ETextureType::Any);
void Uninit(); void Uninit();
FTexture *operator[] (int index) const; FTexture *operator[] (int index) const;

View File

@ -397,7 +397,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t t
if (!fortext) if (!fortext)
{ {
if (img == NULL || img->UseType == FTexture::TEX_Null) if (img == NULL || img->UseType == ETextureType::Null)
{ {
ListEnd(tags); ListEnd(tags);
return false; return false;
@ -1304,11 +1304,11 @@ void V_DrawBorder (int x1, int y1, int x2, int y2)
if (level.info != NULL && level.info->BorderTexture.Len() != 0) if (level.info != NULL && level.info->BorderTexture.Len() != 0)
{ {
picnum = TexMan.CheckForTexture (level.info->BorderTexture, FTexture::TEX_Flat); picnum = TexMan.CheckForTexture (level.info->BorderTexture, ETextureType::Flat);
} }
else else
{ {
picnum = TexMan.CheckForTexture (gameinfo.BorderFlat, FTexture::TEX_Flat); picnum = TexMan.CheckForTexture (gameinfo.BorderFlat, ETextureType::Flat);
} }
if (picnum.isValid()) if (picnum.isValid())

View File

@ -332,7 +332,7 @@ FFont *V_GetFont(const char *name)
} }
if (font == NULL) if (font == NULL)
{ {
FTextureID picnum = TexMan.CheckForTexture (name, FTexture::TEX_Any); FTextureID picnum = TexMan.CheckForTexture (name, ETextureType::Any);
if (picnum.isValid()) if (picnum.isValid())
{ {
font = new FSinglePicFont (name); font = new FSinglePicFont (name);
@ -390,15 +390,15 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
charlumps[i] = NULL; charlumps[i] = NULL;
mysnprintf (buffer, countof(buffer), nametemplate, i + start); mysnprintf (buffer, countof(buffer), nametemplate, i + start);
lump = TexMan.CheckForTexture(buffer, FTexture::TEX_MiscPatch); lump = TexMan.CheckForTexture(buffer, ETextureType::MiscPatch);
if (doomtemplate && lump.isValid() && i + start == 121) if (doomtemplate && lump.isValid() && i + start == 121)
{ // HACKHACK: Don't load STCFN121 in doom(2), because { // HACKHACK: Don't load STCFN121 in doom(2), because
// it's not really a lower-case 'y' but a '|'. // it's not really a lower-case 'y' but a '|'.
// Because a lot of wads with their own font seem to foolishly // Because a lot of wads with their own font seem to foolishly
// copy STCFN121 and make it a '|' themselves, wads must // copy STCFN121 and make it a '|' themselves, wads must
// provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load as a 'y'. // provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load as a 'y'.
if (!TexMan.CheckForTexture("STCFN120", FTexture::TEX_MiscPatch).isValid() || if (!TexMan.CheckForTexture("STCFN120", ETextureType::MiscPatch).isValid() ||
!TexMan.CheckForTexture("STCFN122", FTexture::TEX_MiscPatch).isValid()) !TexMan.CheckForTexture("STCFN122", ETextureType::MiscPatch).isValid())
{ {
// insert the incorrectly named '|' graphic in its correct position. // 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[lump];
@ -1572,7 +1572,7 @@ void FSingleLumpFont::FixupPalette (uint8_t *identity, double *luminosity, const
FSinglePicFont::FSinglePicFont(const char *picname) : FSinglePicFont::FSinglePicFont(const char *picname) :
FFont(-1) // Since lump is only needed for priority information we don't need to worry about this here. FFont(-1) // Since lump is only needed for priority information we don't need to worry about this here.
{ {
FTextureID picnum = TexMan.CheckForTexture (picname, FTexture::TEX_Any); FTextureID picnum = TexMan.CheckForTexture (picname, ETextureType::Any);
if (!picnum.isValid()) if (!picnum.isValid())
{ {
@ -1639,7 +1639,7 @@ int FSinglePicFont::GetCharWidth (int code) const
FFontChar1::FFontChar1 (FTexture *sourcelump) FFontChar1::FFontChar1 (FTexture *sourcelump)
: SourceRemap (NULL) : SourceRemap (NULL)
{ {
UseType = FTexture::TEX_FontChar; UseType = ETextureType::FontChar;
BaseTexture = sourcelump; BaseTexture = sourcelump;
// now copy all the properties from the base texture // now copy all the properties from the base texture
@ -1758,7 +1758,7 @@ FFontChar1::~FFontChar1 ()
FFontChar2::FFontChar2 (int sourcelump, int sourcepos, int width, int height, int leftofs, int topofs) FFontChar2::FFontChar2 (int sourcelump, int sourcepos, int width, int height, int leftofs, int topofs)
: SourceLump (sourcelump), SourcePos (sourcepos), Pixels (0), Spans (0), SourceRemap(NULL) : SourceLump (sourcelump), SourcePos (sourcepos), Pixels (0), Spans (0), SourceRemap(NULL)
{ {
UseType = TEX_FontChar; UseType = ETextureType::FontChar;
Width = width; Width = width;
Height = height; Height = height;
LeftOffset = leftofs; LeftOffset = leftofs;
@ -2270,7 +2270,7 @@ void V_InitCustomFonts()
if (format == 1) goto wrong; if (format == 1) goto wrong;
FTexture **p = &lumplist[*(unsigned char*)sc.String]; FTexture **p = &lumplist[*(unsigned char*)sc.String];
sc.MustGetString(); sc.MustGetString();
FTextureID texid = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch); FTextureID texid = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch);
if (texid.Exists()) if (texid.Exists())
{ {
*p = TexMan[texid]; *p = TexMan[texid];

View File

@ -371,7 +371,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
// a name with a starting '$' indicates an intermission script // a name with a starting '$' indicates an intermission script
if (*lumpname != '$') if (*lumpname != '$')
{ {
texture = TexMan.CheckForTexture(lumpname, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny); texture = TexMan.CheckForTexture(lumpname, ETextureType::MiscPatch, FTextureManager::TEXMAN_TryAny);
} }
else else
{ {
@ -387,7 +387,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
{ {
case 0: // Background case 0: // Background
sc.MustGetString(); sc.MustGetString();
texture = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny); texture = TexMan.CheckForTexture(sc.String, ETextureType::MiscPatch, FTextureManager::TEXMAN_TryAny);
break; break;
case 1: // Splat case 1: // Splat
@ -525,7 +525,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
else else
{ {
Printf("Intermission script %s not found!\n", lumpname + 1); Printf("Intermission script %s not found!\n", lumpname + 1);
texture = TexMan.GetTexture("INTERPIC", FTexture::TEX_MiscPatch); texture = TexMan.GetTexture("INTERPIC", ETextureType::MiscPatch);
} }
} }
background = TexMan[texture]; background = TexMan[texture];
@ -598,7 +598,7 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
if (background) if (background)
{ {
// background // background
if (background->UseType == FTexture::TEX_MiscPatch) if (background->UseType == ETextureType::MiscPatch)
{ {
// scale all animations below to fit the size of the base pic // scale all animations below to fit the size of the base pic
// The base pic is always scaled to fit the screen so this allows // The base pic is always scaled to fit the screen so this allows

View File

@ -933,7 +933,7 @@ bool I_SetCursor(FTexture *cursorpic)
{ {
HCURSOR cursor; HCURSOR cursor;
if (cursorpic != NULL && cursorpic->UseType != FTexture::TEX_Null && if (cursorpic != NULL && cursorpic->UseType != ETextureType::Null &&
(screen == NULL || !screen->Is8BitMode())) (screen == NULL || !screen->Is8BitMode()))
{ {
// Must be no larger than 32x32. // Must be no larger than 32x32.

View File

@ -181,7 +181,7 @@ vec3 ProcessMaterial(vec3 albedo, vec3 ambientLight)
//vec3 ambient = (kD * diffuse + specular) * ao; //vec3 ambient = (kD * diffuse + specular) * ao;
vec3 ambient = (kD * diffuse) * ao; vec3 ambient = (kD * diffuse) * ao;
vec3 color = ambient + Lo; vec3 color = max(ambient + Lo, vec3(0.0));
// Tonemap (reinhard) and apply sRGB gamma // Tonemap (reinhard) and apply sRGB gamma
//color = color / (color + vec3(1.0)); //color = color / (color + vec3(1.0));

View File

@ -57,9 +57,9 @@ struct Side native play
WALLF_LIGHT_FOG = 128, // This wall's Light is used even in fog. WALLF_LIGHT_FOG = 128, // This wall's Light is used even in fog.
}; };
native Sector sector; // Sector the SideDef is facing. native readonly Sector sector; // Sector the SideDef is facing.
//DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall //DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall
native Line linedef; native readonly Line linedef;
native int16 Light; native int16 Light;
native uint8 Flags; native uint8 Flags;