Initial support for custom tile sizes

This commit is contained in:
Paul Chote
2010-09-15 17:13:18 +12:00
parent 5b8fc75d4a
commit be47fb55e8
9 changed files with 81 additions and 77 deletions

View File

@@ -68,9 +68,9 @@ namespace OpenRA.Graphics
int indicesPerRow = map.Width * 6;
int verticesPerRow = map.Width * 4;
int visibleRows = (int)(viewport.Height / 24.0f + 2);
int visibleRows = (int)(viewport.Height * 1f / Game.CellSize + 2);
int firstRow = (int)((viewport.Location.Y) / 24.0f - map.YOffset);
int firstRow = (int)(viewport.Location.Y * 1f / Game.CellSize - map.YOffset);
int lastRow = firstRow + visibleRows;
if (lastRow < 0 || firstRow > map.Height)

View File

@@ -142,8 +142,8 @@ namespace OpenRA.Graphics
for (var j = 0; j < world.Map.MapSize.Y;
j += world.WorldActor.Info.Traits.Get<SpatialBinsInfo>().BinSize)
{
Game.Renderer.LineRenderer.DrawLine(new float2(0, j * 24), new float2(world.Map.MapSize.X * 24, j * 24), Color.Black, Color.Black);
Game.Renderer.LineRenderer.DrawLine(new float2(j * 24, 0), new float2(j * 24, world.Map.MapSize.Y * 24), Color.Black, Color.Black);
Game.Renderer.LineRenderer.DrawLine(new float2(0, j * Game.CellSize), new float2(world.Map.MapSize.X * Game.CellSize, j * Game.CellSize), Color.Black, Color.Black);
Game.Renderer.LineRenderer.DrawLine(new float2(j * Game.CellSize, 0), new float2(j * Game.CellSize, world.Map.MapSize.Y * Game.CellSize), Color.Black, Color.Black);
}
}