Add missing lower and upper

This commit is contained in:
Magnus Norddahl 2025-05-31 20:00:29 +02:00
commit 1d635d9a39
5 changed files with 31 additions and 14 deletions

View file

@ -329,7 +329,7 @@ void DoomLevelMesh::AddSectorsToDrawLists(const TArray<int>& sectors, LevelMeshD
}
}
void DoomLevelMesh::AddSidesToDrawLists(const TArray<int>& sides, LevelMeshDrawLists& lists)
void DoomLevelMesh::AddSidesToDrawLists(const TArray<int>& sides, LevelMeshDrawLists& lists, HWDrawInfo* di)
{
for (int sideIndex : sides)
{
@ -337,6 +337,16 @@ void DoomLevelMesh::AddSidesToDrawLists(const TArray<int>& sides, LevelMeshDrawL
{
lists.Add(di.DrawType, di.PipelineID, { di.IndexStart, di.IndexStart + di.IndexCount });
}
for (const HWMissing& missing : Sides[sideIndex].MissingUpper)
{
di->AddUpperMissingTexture(missing.side, missing.sub, missing.plane);
}
for (const HWMissing& missing : Sides[sideIndex].MissingLower)
{
di->AddLowerMissingTexture(missing.side, missing.sub, missing.plane);
}
}
}
@ -660,6 +670,8 @@ void DoomLevelMesh::FreeSide(FLevelLocals& doomMap, unsigned int sideIndex)
Sides[sideIndex].Uniforms.Clear();
Sides[sideIndex].WallPortals.Clear();
Sides[sideIndex].MissingUpper.Clear();
Sides[sideIndex].MissingLower.Clear();
Sides[sideIndex].Decals.Clear();
}
@ -1090,10 +1102,14 @@ void DoomLevelMesh::CreateSide(FLevelLocals& doomMap, unsigned int sideIndex)
state.SetRenderStyle(STYLE_Normal);
*/
for (HWWall& portal : result.portals)
{
for (const HWWall& portal : result.portals)
sideBlock.WallPortals.Push(portal);
}
for (const HWMissing& missing : result.upper)
sideBlock.MissingUpper.Push(missing);
for (const HWMissing& missing : result.lower)
sideBlock.MissingLower.Push(missing);
// Add portal surface to the level mesh so raytraces can see them
CreateWallSurface(side, disp, state, result.portals, LevelMeshDrawType::Portal, sideIndex, sideBlock.Lights);