Skip to content

Commit

Permalink
Moved Grid, Tileset, and ReplacedInvalidTerrainTiles from IMap to IMa…
Browse files Browse the repository at this point in the history
…pCell
  • Loading branch information
AspectInteractive2 committed Jan 29, 2023
1 parent afce419 commit 265dce0
Show file tree
Hide file tree
Showing 66 changed files with 168 additions and 148 deletions.
2 changes: 1 addition & 1 deletion OpenRA.Game/CPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override string ToString()
return X + "," + Y + "," + Layer;
}

public MPos ToMPos(IMap map)
public MPos ToMPos(IMapCell map)
{
return ToMPos(map.Grid.Type);
}
Expand Down
7 changes: 4 additions & 3 deletions OpenRA.Game/Graphics/TerrainSpriteLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void Update(CPos cell, Sprite sprite, PaletteReference palette, float sca
xyz = worldRenderer.Screen3DPosition(cellOrigin) + scale * (sprite.Offset - 0.5f * sprite.Size);
}

Update(cell.ToMPos(map.Grid.Type), sprite, palette, xyz, scale, alpha, ignoreTint);
Update(cell.ToMPos(mapCell.Grid.Type), sprite, palette, xyz, scale, alpha, ignoreTint);
}

void UpdateTint(MPos uv)
Expand All @@ -115,8 +115,9 @@ void UpdateTint(MPos uv)
// This is done by sampling the lighting the corners of the sprite, even though those pixels are
// transparent for isometric tiles
var tl = worldRenderer.TerrainLighting;
var pos = ((IMapCell)map).CenterOfCell(uv.ToCPos((IMapCell)map));
var step = map.Grid.Type == MapGridType.RectangularIsometric ? 724 : 512;
var mapCell = (IMapCell)map;
var pos = mapCell.CenterOfCell(uv.ToCPos((IMapCell)map));
var step = mapCell.Grid.Type == MapGridType.RectangularIsometric ? 724 : 512;
var weights = new[]
{
tl.TintAt(pos + new WVec(-step, -step, 0)),
Expand Down
8 changes: 4 additions & 4 deletions OpenRA.Game/Graphics/Viewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public Viewport(WorldRenderer wr, IMapCell map)
// The full map is visible in the editor
var width = map.MapSize.X * grid.TileSize.Width;
var height = map.MapSize.Y * grid.TileSize.Height;
if (wr.World.Map.Grid.Type == MapGridType.RectangularIsometric)
if (((IMapCell)wr.World.Map).Grid.Type == MapGridType.RectangularIsometric)
height /= 2;

mapBounds = new Rectangle(0, 0, width, height);
Expand Down Expand Up @@ -300,12 +300,12 @@ public CPos ViewToWorld(int2 view)
/// <summary> Returns an unfiltered list of all cells that could potentially contain the mouse cursor</summary>
IEnumerable<MPos> CandidateMouseoverCells(int2 world)
{
var map = worldRenderer.World.Map;
var mapCell = (IMapCell)worldRenderer.World.Map;
var minPos = worldRenderer.ProjectedPosition(world);

// Find all the cells that could potentially have been clicked
var a = ((IMapCell)map).CellContaining(minPos - new WVec(1024, 0, 0)).ToMPos(map.Grid.Type);
var b = ((IMapCell)map).CellContaining(minPos + new WVec(512, 512 * map.Grid.MaximumTerrainHeight, 0)).ToMPos(map.Grid.Type);
var a = mapCell.CellContaining(minPos - new WVec(1024, 0, 0)).ToMPos(mapCell.Grid.Type);
var b = mapCell.CellContaining(minPos + new WVec(512, 512 * mapCell.Grid.MaximumTerrainHeight, 0)).ToMPos(mapCell.Grid.Type);

for (var v = b.V; v >= a.V; v--)
for (var u = b.U; u >= a.U; u--)
Expand Down
5 changes: 3 additions & 2 deletions OpenRA.Game/Graphics/WorldRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public sealed class WorldRenderer : IDisposable
internal WorldRenderer(ModData modData, World world)
{
World = world;
TileSize = World.Map.Grid.TileSize;
TileScale = World.Map.Grid.Type == MapGridType.RectangularIsometric ? 1448 : 1024;
var mapCell = (IMapCell)World.Map;
TileSize = mapCell.Grid.TileSize;
TileScale = mapCell.Grid.Type == MapGridType.RectangularIsometric ? 1448 : 1024;
Viewport = new Viewport(this, (IMapCell)world.Map);

createPaletteReference = CreatePaletteReference;
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Map/CellLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class CellLayer<T> : CellLayerBase<T>
{
public event Action<CPos> CellEntryChanged = null;

public CellLayer(IMap map)
public CellLayer(IMapCell map)
: base(map) { }

public CellLayer(MapGridType gridType, Size size)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Map/CellLayerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class CellLayerBase<T> : IEnumerable<T>
protected readonly T[] Entries;
protected readonly Rectangle Bounds;

public CellLayerBase(IMap map)
public CellLayerBase(IMapCell map)
: this(map.Grid.Type, new Size(map.MapSize.X, map.MapSize.Y)) { }

public CellLayerBase(MapGridType gridType, Size size)
Expand Down
5 changes: 0 additions & 5 deletions OpenRA.Game/Map/IMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public interface IMap
string RequiresMod { get; set; }
string Title { get; }
string Author { get; }
string Tileset { get; }
bool LockPreview { get; }
Rectangle Bounds { get; }
MapVisibility Visibility { get; }
Expand All @@ -30,10 +29,6 @@ public interface IMap
MiniYaml VoiceDefinitions { get; }
MiniYaml MusicDefinitions { get; }
MiniYaml NotificationDefinitions { get; }

Dictionary<CPos, TerrainTile> ReplacedInvalidTerrainTiles { get; }

MapGrid Grid { get; }
bool InvalidCustomRules { get; }
Exception InvalidCustomRulesException { get; }
IReadOnlyPackage Package { get; }
Expand Down
3 changes: 3 additions & 0 deletions OpenRA.Game/Map/IMapCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace OpenRA
{
public interface IMapCell : IMap
{
Dictionary<CPos, TerrainTile> ReplacedInvalidTerrainTiles { get; }
MapGrid Grid { get; }
string Tileset { get; }
CellRegion AllCells { get; }
List<CPos> AllEdgeCells { get; }
WDist CellHeightStep { get; }
Expand Down
6 changes: 0 additions & 6 deletions OpenRA.Game/Map/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public abstract class Map : IReadOnlyFileSystem, IMap
string IMap.RequiresMod { get => RequiresMod; set => RequiresMod = value; }
public string Title;
public string Author;
public string Tileset;
public bool LockPreview;
public Rectangle Bounds;
public MapVisibility Visibility = MapVisibility.Lobby;
Expand All @@ -55,7 +54,6 @@ public abstract class Map : IReadOnlyFileSystem, IMap

string IMap.Author => Author;

string IMap.Tileset => Tileset;

bool IMap.LockPreview => LockPreview;

Expand Down Expand Up @@ -95,10 +93,6 @@ public abstract class Map : IReadOnlyFileSystem, IMap
MiniYaml IMap.NotificationDefinitions => NotificationDefinitions;

public readonly Dictionary<CPos, TerrainTile> ReplacedInvalidTerrainTiles = new Dictionary<CPos, TerrainTile>();
Dictionary<CPos, TerrainTile> IMap.ReplacedInvalidTerrainTiles => ReplacedInvalidTerrainTiles;

// Generated data
MapGrid IMap.Grid => Grid;

protected CVec[][] GridTilesByDistance => Grid.TilesByDistance;

Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Game/Map/MapPreview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ public MapPreview(IMap map, ModData modData)
Title = map.Title,
Categories = map.Categories,
Author = map.Author,
TileSet = map.Tileset,
TileSet = ((IMapCell)map).Tileset,
Players = mapPlayers,
PlayerCount = mapPlayers.Players.Count(x => x.Value.Playable),
SpawnPoints = spawns.ToArray(),
GridType = map.Grid.Type,
GridType = ((IMapCell)map).Grid.Type,
Bounds = map.Bounds,
Preview = null,
Status = MapStatus.Available,
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Map/ProjectedCellLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed class ProjectedCellLayer<T> : CellLayerBase<T>
{
public int MaxIndex => Size.Width * Size.Height;

public ProjectedCellLayer(IMap map)
public ProjectedCellLayer(IMapCell map)
: base(map) { }

public ProjectedCellLayer(MapGridType gridType, Size size)
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Game/Map/ProjectedCellRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ProjectedCellRegion : IEnumerable<PPos>
readonly MPos mapTopLeft;
readonly MPos mapBottomRight;

public ProjectedCellRegion(IMap map, PPos topLeft, PPos bottomRight)
public ProjectedCellRegion(IMapCell map, PPos topLeft, PPos bottomRight)
{
TopLeft = topLeft;
BottomRight = bottomRight;
Expand All @@ -45,7 +45,7 @@ public ProjectedCellRegion(IMap map, PPos topLeft, PPos bottomRight)
var heightOffset = map.Grid.Type == MapGridType.RectangularIsometric ? maxHeight : maxHeight / 2;

// Use the map Height data array to clamp the bottom coordinate so it doesn't overflow the map
mapBottomRight = ((IMapCell)map).Height.Clamp(new MPos(bottomRight.U, bottomRight.V + heightOffset));
mapBottomRight = map.Height.Clamp(new MPos(bottomRight.U, bottomRight.V + heightOffset));
}

public bool Contains(PPos puv)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Traits/World/ScreenMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class ScreenMap : IWorldLoaded

public ScreenMap(World world, ScreenMapInfo info)
{
var size = world.Map.Grid.TileSize;
var size = ((IMapCell)world.Map).Grid.TileSize;
var width = world.Map.MapSize.X * size.Width;
var height = world.Map.MapSize.Y * size.Height;

Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Cnc/Activities/Teleport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Teleport : Activity
bool killCargo, bool screenFlash, string sound, bool interruptable = true,
bool killOnFailure = false, BitSet<DamageType> killDamageTypes = default)
{
var max = teleporter.World.Map.Grid.MaximumTileSearchRange;
var max = ((IMapCell)teleporter.World.Map).Grid.MaximumTileSearchRange;
if (maximumDistance > max)
throw new InvalidOperationException($"Teleport distance cannot exceed the value of MaximumTileSearchRange ({max}).");

Expand Down Expand Up @@ -131,7 +131,7 @@ public override bool Tick(Actor self)
if (pos.CanEnterCell(destination) && teleporter.Owner.Shroud.IsExplored(destination))
return destination;

var max = maximumDistance != null ? maximumDistance.Value : teleporter.World.Map.Grid.MaximumTileSearchRange;
var max = maximumDistance != null ? maximumDistance.Value : ((IMapCell)teleporter.World.Map).Grid.MaximumTileSearchRange;
foreach (var tile in mapCell.FindTilesInCircle(destination, max))
{
if (teleporter.Owner.Shroud.IsExplored(tile)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/Traits/ConyardChronoReturn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void TriggerVortex()
if (mobileInfo.CanEnterCell(self.World, null, destination))
return destination;

var max = chronosphere.World.Map.Grid.MaximumTileSearchRange;
var max = ((IMapCell)chronosphere.World.Map).Grid.MaximumTileSearchRange;
foreach (var tile in ((IMapCell)self.World.Map).FindTilesInCircle(destination, max))
if (chronosphere.Owner.Shroud.IsExplored(tile) && mobileInfo.CanEnterCell(self.World, null, tile))
return tile;
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Cnc/Traits/Minelayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Minelayer(Actor self, MinelayerInfo info)
Info = info;
this.self = self;

var tileset = self.World.Map.Tileset.ToLowerInvariant();
var tileset = ((IMapCell)self.World.Map).Tileset.ToLowerInvariant();
if (self.World.Map.Rules.Sequences.HasSequence("overlay", $"{Info.TileValidName}-{tileset}"))
Tile = self.World.Map.Rules.Sequences.GetSequence("overlay", $"{Info.TileValidName}-{tileset}").GetSprite(0);
else
Expand Down Expand Up @@ -223,7 +223,7 @@ public MinefieldOrderGenerator(Actor a, CPos xy, bool queued)
this.queued = queued;

minelayer = a.Trait<Minelayer>();
var tileset = a.World.Map.Tileset.ToLowerInvariant();
var tileset = ((IMapCell)a.World.Map).Tileset.ToLowerInvariant();
if (a.World.Map.Rules.Sequences.HasSequence("overlay", $"{minelayer.Info.TileValidName}-{tileset}"))
{
var validSequence = a.World.Map.Rules.Sequences.GetSequence("overlay", $"{minelayer.Info.TileValidName}-{tileset}");
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public SelectDestination(World world, string order, SupportPowerManager manager,
dimensions = info.Dimensions;

var sequences = world.Map.Rules.Sequences;
var tilesetValid = info.ValidFootprintSequence + "-" + world.Map.Tileset.ToLowerInvariant();
var tilesetValid = info.ValidFootprintSequence + "-" + ((IMapCell)world.Map).Tileset.ToLowerInvariant();
if (sequences.HasSequence(info.FootprintImage, tilesetValid))
{
var validSequence = sequences.GetSequence(info.FootprintImage, tilesetValid);
Expand Down
5 changes: 3 additions & 2 deletions OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ public TSVeinsRenderer(Actor self, TSVeinsRendererInfo info)
resourceLayer.Info.TryGetTerrainType(info.ResourceType, out var terrainType);
veinRadarColor = terrainInfo.TerrainTypes[terrainInfo.GetTerrainIndex(terrainType)].Color;

renderIndices = new CellLayer<int[]>(world.Map);
borders = new CellLayer<Adjacency>(world.Map);
var mapCell = (IMapCell)world.Map;
renderIndices = new CellLayer<int[]>(mapCell);
borders = new CellLayer<Adjacency>(mapCell);
}

void AddDirtyCell(CPos cell, string resourceType)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/UtilityCommands/ImportTSMapCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static void ReadOverlay(IMap map, IniFile file, int2 fullSize)
var overlayDataPack = new byte[1 << 18];
UnpackLCW(overlayDataCompressed, overlayDataPack, temp);

var overlayIndex = new CellLayer<int>(map);
var overlayIndex = new CellLayer<int>((IMapCell)map);
overlayIndex.Clear(0xFF);

for (var y = 0; y < fullSize.Y; y++)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Commands/DebugVisualizationCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void WorldLoaded(World w, WorldRenderer wr)

foreach (var command in commandHandlers)
{
if (command.Key == "depth-buffer" && !w.Map.Grid.EnableDepthBuffer)
if (command.Key == "depth-buffer" && !((IMapCell)w.Map).Grid.EnableDepthBuffer)
continue;

console.RegisterCommand(command.Key, this);
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public bool HandleMouseInput(MouseInput mi)
{
if (mi.Event != MouseInputEvent.Down)
break;
var gridType = worldRenderer.World.Map.Grid.Type;
var gridType = ((IMapCell)worldRenderer.World.Map).Grid.Type;
var source = CellRegion.BoundingRegion(gridType, new[] { start, end });
Copy(source, cell - end);
break;
Expand All @@ -109,8 +109,8 @@ public bool HandleMouseInput(MouseInput mi)

void Copy(CellRegion source, CVec offset)
{
var gridType = worldRenderer.World.Map.Grid.Type;
var mapCell = (IMapCell)worldRenderer.World.Map;
var gridType = mapCell.Grid.Type;
var mapResource = (IMapResource)worldRenderer.World.Map;
var mapTiles = mapCell.Tiles;
var mapHeight = mapCell.Height;
Expand Down
6 changes: 3 additions & 3 deletions OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void Do()
undoTiles.Enqueue(new UndoTile(c, mapTiles[c], mapHeight[c]));

mapTiles[c] = new TerrainTile(template, index);
mapHeight[c] = (byte)(baseHeight + terrainTemplate[index].Height).Clamp(0, map.Grid.MaximumTerrainHeight);
mapHeight[c] = (byte)(baseHeight + terrainTemplate[index].Height).Clamp(0, ((IMapCell)map).Grid.MaximumTerrainHeight);
}
}
}
Expand Down Expand Up @@ -256,7 +256,7 @@ public void Do()
{
var mapCell = (IMapCell)map;
var queue = new Queue<CPos>();
var touched = new CellLayer<bool>(map);
var touched = new CellLayer<bool>((IMapCell)map);
var mapTiles = mapCell.Tiles;
var replace = mapTiles[cell];

Expand Down Expand Up @@ -356,7 +356,7 @@ void PaintSingleCell(CPos cellToPaint)
undoTiles.Enqueue(new UndoTile(c, mapTiles[c], mapHeight[c]));

mapTiles[c] = new TerrainTile(template, index);
mapHeight[c] = (byte)(baseHeight + terrainTemplate[index].Height).Clamp(0, map.Grid.MaximumTerrainHeight);
mapHeight[c] = (byte)(baseHeight + terrainTemplate[index].Height).Clamp(0, mapCell.Grid.MaximumTerrainHeight);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Graphics/ModelRenderable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void Render(WorldRenderer wr)
public void RenderDebugGeometry(WorldRenderer wr)
{
var groundPos = model.pos - new WVec(0, 0, ((IMapCell)wr.World.Map).DistanceAboveTerrain(model.pos).Length);
var groundZ = wr.World.Map.Grid.TileSize.Height * (groundPos.Z - model.pos.Z) / 1024f;
var groundZ = ((IMapCell)wr.World.Map).Grid.TileSize.Height * (groundPos.Z - model.pos.Z) / 1024f;
var pxOrigin = wr.Screen3DPosition(model.pos);
var shadowOrigin = pxOrigin - groundZ * (new float2(renderProxy.ShadowDirection, 1));

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Lint/CheckMapTiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CheckMapTiles : ILintMapPass
{
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, IMap map)
{
foreach (var kv in map.ReplacedInvalidTerrainTiles)
foreach (var kv in ((IMapCell)map).ReplacedInvalidTerrainTiles)
emitError($"Cell {kv.Key} references invalid terrain tile {kv.Value}.");
}
}
Expand Down
6 changes: 6 additions & 0 deletions OpenRA.Mods.Common/MapFormats/DefaultMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public class DefaultMap : Map, IMapCell, IMapResource
public WPos ProjectedBottomRight { get; private set; }

public CellLayer<TerrainTile> Tiles { get; protected set; }
public string Tileset;
public CellLayer<ResourceTile> Resources { get; protected set; }
public CellLayer<byte> Height { get; protected set; }
public CellLayer<byte> Ramp { get; protected set; }
Expand All @@ -198,6 +199,11 @@ public class DefaultMap : Map, IMapCell, IMapResource
public PPos[] ProjectedCells { get; private set; }
public CellRegion AllCells { get; private set; }
public List<CPos> AllEdgeCells { get; private set; }
Dictionary<CPos, TerrainTile> IMapCell.ReplacedInvalidTerrainTiles => ReplacedInvalidTerrainTiles;
string IMapCell.Tileset => Tileset;
MapGrid IMapCell.Grid => Grid;

// Generated data

/// <summary>Defines the order of the fields in map.yaml</summary>
static readonly MapField[] YamlFields =
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Pathfinder/CellInfoLayerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CellLayer<CellInfo> GetLayer()
// we don't need to initialize the values in the layer,
// we can just clear them to the defaults.
if (layer == null)
layer = new CellLayer<CellInfo>(map);
layer = new CellLayer<CellInfo>((IMapCell)map);
else
layer.Clear();

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Pathfinder/DensePathGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class DensePathGraph : IPathGraph
this.ignoreActor = ignoreActor;
this.laneBias = laneBias;
this.inReverse = inReverse;
checkTerrainHeight = world.Map.Grid.MaximumTerrainHeight > 0;
checkTerrainHeight = ((IMapCell)world.Map).Grid.MaximumTerrainHeight > 0;
}

public abstract CellInfo this[CPos node] { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public HierarchicalPathFinder(World world, Locomotor locomotor, IActorMap actorM
/// </summary>
void BuildGrids()
{
Grid GetCPosBounds(IMap map)
Grid GetCPosBounds(IMapCell map)
{
if (map.Grid.Type == MapGridType.RectangularIsometric)
{
Expand All @@ -322,7 +322,7 @@ Grid GetCPosBounds(IMap map)
return new Grid(CPos.Zero, (CPos)map.MapSize, false);
}

mapBounds = GetCPosBounds(world.Map);
mapBounds = GetCPosBounds((IMapCell)world.Map);
gridXs = Exts.IntegerDivisionRoundingAwayFromZero(mapBounds.Width, GridSize);
gridYs = Exts.IntegerDivisionRoundingAwayFromZero(mapBounds.Height, GridSize);

Expand Down
Loading

0 comments on commit 265dce0

Please sign in to comment.