mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-21 10:20:46 +00:00
Workaround to make 3d floor side surfaces detectable
This commit is contained in:
parent
3bf0669c57
commit
294a2c4e3c
3 changed files with 28 additions and 3 deletions
|
@ -377,9 +377,16 @@ void DoomLevelMesh::BindLightmapSurfacesToGeometry(FLevelLocals& doomMap)
|
|||
// Runtime helper
|
||||
for (auto& surface : Surfaces)
|
||||
{
|
||||
if ((surface.Type == ST_FLOOR || surface.Type == ST_CEILING) && surface.ControlSector)
|
||||
if (surface.ControlSector)
|
||||
{
|
||||
XFloorToSurface[surface.Subsector->sector].Push(&surface);
|
||||
if (surface.Type == ST_FLOOR || surface.Type == ST_CEILING)
|
||||
{
|
||||
XFloorToSurface[surface.Subsector->sector].Push(&surface);
|
||||
}
|
||||
else if (surface.Type == ST_MIDDLESIDE)
|
||||
{
|
||||
XFloorToSurfaceSides[surface.ControlSector].Push(&surface);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ public:
|
|||
static_assert(alignof(FVector2) == alignof(float[2]) && sizeof(FVector2) == sizeof(float) * 2);
|
||||
|
||||
// runtime utility variables
|
||||
TMap<sector_t*, TArray<DoomLevelMeshSurface*>> XFloorToSurface;
|
||||
TMap<const sector_t*, TArray<DoomLevelMeshSurface*>> XFloorToSurface;
|
||||
TMap<const sector_t*, TArray<DoomLevelMeshSurface*>> XFloorToSurfaceSides;
|
||||
|
||||
private:
|
||||
void CreateSubsectorSurfaces(FLevelLocals &doomMap);
|
||||
|
|
|
@ -527,6 +527,23 @@ void HWFlat::ProcessSector(HWDrawInfo *di, FRenderState& state, sector_t * front
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sector->e->XFloor.ffloors.Size())
|
||||
{
|
||||
for (auto* floor : sector->e->XFloor.ffloors)
|
||||
{
|
||||
if (auto sides = sector->Level->levelMesh->XFloorToSurfaceSides.CheckKey(floor->model))
|
||||
{
|
||||
for (auto* surface : *sides)
|
||||
{
|
||||
if (surface)
|
||||
{
|
||||
state.PushVisibleSurface(surface);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue