mirror of
https://github.com/ZDoom/ZDRay.git
synced 2024-11-24 21:01:15 +00:00
Skip sides that have no valid texture
This commit is contained in:
parent
01cd022fd6
commit
13df9b2b32
3 changed files with 22 additions and 4 deletions
|
@ -118,7 +118,18 @@ public:
|
|||
HIT_Columnmode = HIT_Wall | HIT_Sky | HIT_Sprite
|
||||
};
|
||||
|
||||
FTextureID CheckForTexture(const char* name, ETextureType usetype, uint32_t flags = TEXMAN_TryAny) { return {}; }
|
||||
FTextureID CheckForTexture(const char* name, ETextureType usetype, uint32_t flags = TEXMAN_TryAny)
|
||||
{
|
||||
if (name == nullptr || name[0] == '\0')
|
||||
return FTextureID(-1);
|
||||
if (name[0] == '-' && name[1] == '\0')
|
||||
return FTextureID(0);
|
||||
|
||||
// To do: actually build up a list of texture ids
|
||||
return FTextureID(1);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
extern FTextureManager TexMan;
|
||||
|
|
|
@ -99,7 +99,12 @@ struct IntSideDef
|
|||
SideDefSampleProps sampling;
|
||||
TArray<UDMFKey> props;
|
||||
|
||||
FTextureID GetTexture(WallPart part) { return FNullTextureID(); }
|
||||
FTextureID GetTexture(WallPart part)
|
||||
{
|
||||
const char* names[3] = { toptexture, midtexture, bottomtexture };
|
||||
return TexMan.CheckForTexture(names[(int)part], ETextureType::Wall);
|
||||
}
|
||||
|
||||
float GetTextureYOffset(WallPart part) { return 0.0f; }
|
||||
float GetTextureYScale(WallPart part) { return 1.0f; }
|
||||
|
||||
|
|
|
@ -111,7 +111,10 @@ void DoomLevelSubmesh::CreateSideSurfaces(std::map<LightmapTileBinding, int>& bi
|
|||
}
|
||||
else if (!back)
|
||||
{
|
||||
CreateFrontWallSurface(bindings, doomMap, side);
|
||||
if (side->GetTexture(WallPart::MIDDLE).isValid())
|
||||
{
|
||||
CreateFrontWallSurface(bindings, doomMap, side);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -195,7 +198,6 @@ void DoomLevelSubmesh::CreateLineHorizonSurface(std::map<LightmapTileBinding, in
|
|||
AddWallVertices(surf, verts);
|
||||
|
||||
SetSideTextureUVs(surf, side, WallPart::TOP, v1Top, v1Bottom, v2Top, v2Bottom);
|
||||
AddSurfaceToTile(surf, bindings, doomMap, side->GetSampleDistance(WallPart::MIDDLE));
|
||||
|
||||
Surfaces.Push(surf);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue