Update polyobjs every frame (wtb UpdateLevelMesh notification about this)

This commit is contained in:
Magnus Norddahl 2024-08-25 15:10:30 +02:00
commit 944c6994b7
2 changed files with 11 additions and 0 deletions

View file

@ -176,6 +176,12 @@ DoomLevelMesh::DoomLevelMesh(FLevelLocals& doomMap)
void DoomLevelMesh::BeginFrame(FLevelLocals& doomMap)
{
// To do: we don't need to always do this. UpdateLevelMesh should tell us when polyobjs move.
for (side_t* side : PolySides)
{
UpdateSide(doomMap, side->Index());
}
CreateLights(doomMap);
}
@ -342,7 +348,10 @@ void DoomLevelMesh::CreateSurfaces(FLevelLocals& doomMap)
side_t* side = &doomMap.sides[i];
bool isPolyLine = !!(side->Flags & WALLF_POLYOBJ);
if (isPolyLine)
{
PolySides.Push(side);
continue;
}
UpdateSide(doomMap, i);
}

View file

@ -133,6 +133,8 @@ private:
TArray<SideSurfaceBlock> Sides;
TArray<FlatSurfaceBlock> Flats;
TArray<side_t*> PolySides;
std::map<LightmapTileBinding, int> bindings;
MeshBuilder state;
bool LightsCreated = false;