public void RegeneratePortalInfo()
{
RoomInfo = new VMRoomInfo[Architecture.RoomData.Count()];
for (int i = 0; i < RoomInfo.Length; i++)
{
RoomInfo[i].Entities = new List <VMEntity>();
RoomInfo[i].Portals = new List <VMRoomPortal>();
RoomInfo[i].Room = Architecture.RoomData[i];
RoomInfo[i].Light = new RoomLighting();
}
foreach (var obj in VM.Entities)
{
var room = GetObjectRoom(obj);
VM.AddToObjList(RoomInfo[room].Entities, obj);
if (obj.EntryPoints[15].ActionFunction != 0)
{ //portal object
AddRoomPortal(obj, room);
}
obj.SetRoom(room);
}
for (ushort i = 0; i < RoomInfo.Length; i++)
{
RefreshLighting(i, i == (RoomInfo.Length - 1));
}
if (VM.UseWorld)
{
World.InvalidateZoom();
}
}