- renamed FTexture's UseType flags and gave them a dedicated type.

This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
This commit is contained in:
Christoph Oelckers 2018-03-25 20:26:16 +02:00
commit e89a598b31
78 changed files with 348 additions and 352 deletions

View file

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

View file

@ -67,7 +67,7 @@ void RenderPolyPlane::RenderNormal(PolyRenderThread *thread, const TriMatrix &wo
if (picnum != skyflatnum)
{
FTexture *tex = TexMan(picnum);
if (!tex || tex->UseType == FTexture::TEX_Null)
if (!tex || tex->UseType == ETextureType::Null)
return;
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;
FTexture *tex = TexMan(picnum);
if (tex->UseType == FTexture::TEX_Null)
if (tex->UseType == ETextureType::Null)
return;
PolyCameraLight *cameraLight = PolyCameraLight::Instance();

View file

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

View file

@ -342,7 +342,7 @@ void PolySkySetup::Update()
}
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.
goto sky1;
}

View file

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

View file

@ -173,7 +173,7 @@ bool RenderPolyWall::RenderLine(PolyRenderThread *thread, const TriMatrix &world
wall.FogBoundary = IsFogBoundary(frontsector, backsector);
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));
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 *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.
// 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);
}
if (tex == nullptr || tex->UseType == FTexture::TEX_Null)
if (tex == nullptr || tex->UseType == ETextureType::Null)
return nullptr;
}
return tex;

View file

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