Remove lazy loading of binary map data.
This commit is contained in:
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down)
|
||||
{
|
||||
// Check the actor is inside the map
|
||||
if (!footprint.All(c => world.Map.MapTiles.Value.Contains(cell + locationOffset + c)))
|
||||
if (!footprint.All(c => world.Map.Tiles.Contains(cell + locationOffset + c)))
|
||||
return true;
|
||||
|
||||
var newActorReference = new ActorReference(Actor.Name);
|
||||
|
||||
@@ -94,9 +94,9 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
void Copy(CellRegion source, CVec offset)
|
||||
{
|
||||
var gridType = worldRenderer.World.Map.Grid.Type;
|
||||
var mapTiles = worldRenderer.World.Map.MapTiles.Value;
|
||||
var mapHeight = worldRenderer.World.Map.MapHeight.Value;
|
||||
var mapResources = worldRenderer.World.Map.MapResources.Value;
|
||||
var mapTiles = worldRenderer.World.Map.Tiles;
|
||||
var mapHeight = worldRenderer.World.Map.Height;
|
||||
var mapResources = worldRenderer.World.Map.Resources;
|
||||
|
||||
var dest = new CellRegion(gridType, source.TopLeft + offset, source.BottomRight + offset);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
var underCursor = editorLayer.PreviewsAt(worldPixel).MinByOrDefault(CalculateActorSelectionPriority);
|
||||
|
||||
var mapResources = world.Map.MapResources.Value;
|
||||
var mapResources = world.Map.Resources;
|
||||
ResourceType type;
|
||||
if (underCursor != null)
|
||||
editorWidget.SetTooltip(underCursor.Tooltip);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
var type = (byte)ResourceType.ResourceType;
|
||||
var index = (byte)ResourceType.MaxDensity;
|
||||
world.Map.MapResources.Value[cell] = new ResourceTile(type, index);
|
||||
world.Map.Resources[cell] = new ResourceTile(type, index);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -77,11 +77,11 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public bool AllowResourceAt(CPos cell)
|
||||
{
|
||||
var mapResources = world.Map.MapResources.Value;
|
||||
var mapResources = world.Map.Resources;
|
||||
if (!mapResources.Contains(cell))
|
||||
return false;
|
||||
|
||||
var tile = world.Map.MapTiles.Value[cell];
|
||||
var tile = world.Map.Tiles[cell];
|
||||
var tileInfo = world.Map.Rules.TileSet.GetTileInfo(tile);
|
||||
if (tileInfo == null)
|
||||
return false;
|
||||
|
||||
@@ -97,8 +97,8 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
void PaintCell(CPos cell, bool isMoving)
|
||||
{
|
||||
var map = world.Map;
|
||||
var mapTiles = map.MapTiles.Value;
|
||||
var mapHeight = map.MapHeight.Value;
|
||||
var mapTiles = map.Tiles;
|
||||
var mapHeight = map.Height;
|
||||
|
||||
var tileset = map.Rules.TileSet;
|
||||
var template = tileset.Templates[Template];
|
||||
@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
void FloodFillWithBrush(CPos cell, bool isMoving)
|
||||
{
|
||||
var map = world.Map;
|
||||
var mapTiles = map.MapTiles.Value;
|
||||
var mapTiles = map.Tiles;
|
||||
var replace = mapTiles[cell];
|
||||
|
||||
if (replace.Type == Template)
|
||||
@@ -203,7 +203,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
bool PlacementOverlapsSameTemplate(TerrainTemplateInfo template, CPos cell)
|
||||
{
|
||||
var map = world.Map;
|
||||
var mapTiles = map.MapTiles.Value;
|
||||
var mapTiles = map.Tiles;
|
||||
var i = 0;
|
||||
for (var y = 0; y < template.Size.Y; y++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user