Use a TArrayView for the lightmap arrays

This commit is contained in:
Magnus Norddahl 2023-12-07 12:48:48 +01:00
commit 58381ec762
6 changed files with 16 additions and 15 deletions

View file

@ -312,11 +312,11 @@ void DoomLevelSubmesh::UpdateDynamic(FLevelLocals& doomMap, int lightmapStartInd
if (isPolyLine)
{
// Make sure we have a lightmap array on the polyobj sidedef
if (!side->lightmap)
if (side->lightmap.Size() == 0)
{
auto array = std::make_unique<DoomLevelMeshSurface*[]>(4);
memset(array.get(), 0, sizeof(DoomLevelMeshSurface*));
side->lightmap = array.get();
side->lightmap = TArrayView<DoomLevelMeshSurface*>(array.get(), 4);
PolyLMSurfaces.Push(std::move(array));
}