Fix 'Could not find space in level mesh buffer' error

Interpolate sector height updates
This commit is contained in:
Magnus Norddahl 2024-08-26 00:49:30 +02:00
commit e94bd7f641
2 changed files with 16 additions and 1 deletions

View file

@ -509,6 +509,11 @@ void DSectorPlaneInterpolation::Interpolate(double smoothratio)
sector->SetPlaneTexZ(pos, oldtexz + (baktexz - oldtexz) * smoothratio, true);
P_RecalculateAttached3DFloors(sector);
sector->CheckPortalPlane(pos);
if (ceiling)
LevelMeshUpdater->CeilingHeightChanged(sector);
else
LevelMeshUpdater->FloorHeightChanged(sector);
}
}

View file

@ -404,7 +404,7 @@ void DoomLevelMesh::FreeFlat(FLevelLocals& doomMap, unsigned int sectorIndex)
while (surf != -1)
{
unsigned int next = DoomSurfaceInfos[surf].NextSurface;
FreeSurface(surf - 1);
FreeSurface(surf);
surf = next;
}
Flats[sectorIndex].FirstSurface = -1;
@ -475,6 +475,16 @@ void DoomLevelMesh::SideTextureChanged(struct side_t* side, int section)
void DoomLevelMesh::SectorLightChanged(struct sector_t* sector)
{
/*
UpdateFlat(level, sector->Index());
for (line_t* line : sector->Lines)
{
if (line->frontsector == sector && line->sidedef[0])
UpdateSide(level, line->sidedef[0]->Index());
else if (line->sidedef[1])
UpdateSide(level, line->sidedef[1]->Index());
}
*/
}
void DoomLevelMesh::SectorLightThinkerCreated(struct sector_t* sector, class DLighting* lightthinker)