Introduce a new type for representing map coordinates.

To resolve the ambiguity introduced when the introduction of isometric maps meant that cell and map coordinates were no longer equivalent, a new type has been introduced so they can each be represented separately.
This commit is contained in:
RoosterDragon
2014-12-22 19:07:20 +00:00
parent 40c9d0a47d
commit 7cfece6dc0
21 changed files with 257 additions and 232 deletions

View File

@@ -36,12 +36,12 @@ namespace OpenRA.Mods.Common.Traits
var shroudObscured = world.ShroudObscuresTest(wr.Viewport.VisibleCells);
foreach (var uv in wr.Viewport.VisibleCells.MapCoords)
{
if (shroudObscured(uv.X, uv.Y))
if (shroudObscured(uv))
continue;
var c = render[uv.X, uv.Y];
var c = render[uv];
if (c.Sprite != null)
new SpriteRenderable(c.Sprite, wr.World.Map.CenterOfCell(Map.MapToCell(world.Map.TileShape, uv)),
new SpriteRenderable(c.Sprite, wr.World.Map.CenterOfCell(uv.ToCPos(world.Map)),
WVec.Zero, -511, c.Type.Palette, 1f, true).Render(wr); // TODO ZOffset is ignored
}
}