Improve camera sector search somewhat

This commit is contained in:
Magnus Norddahl 2019-12-26 01:10:00 +01:00
parent 459742c840
commit 061fa30a45

View file

@ -593,6 +593,15 @@ namespace CodeImp.DoomBuilder.VisualModes
if(processgeometry)
{
// Find camera sector
Sector camsector = blockmap.GetSectorAt(campos2d);
if (camsector != null)
{
General.Map.VisualCamera.Sector = camsector;
}
else
{
// To do: fix this code. It is retarded. Walking over all visible lines is extremely expensive.
Linedef nld = MapSet.NearestLinedef(visiblelines, campos2d);
if (nld != null)
{
@ -633,6 +642,7 @@ namespace CodeImp.DoomBuilder.VisualModes
}
}
}
}
// This finds and adds visible sectors
private void ProcessSidedefCulling(Sidedef sd)