Introduce initial PPos plumbing.

PPos is best thought of as a cell grid applied in
screen space.  Multiple cells with different
terrain heights may be projected to the same PPos,
or to multiple PPos if they do not align with the
screen grid.

PPos coordinates are used primarily for map edge
checks and shroud / visibility queries.
This commit is contained in:
Paul Chote
2015-06-23 19:41:34 +01:00
parent fb5bcd3889
commit e8794032e0
14 changed files with 381 additions and 63 deletions

View File

@@ -64,8 +64,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var tileset = modRules.TileSets[tilesetDropDown.Text];
var map = new Map(tileset, width + 2, height + maxTerrainHeight + 2);
var tl = new MPos(1, 1);
var br = new MPos(width, height + maxTerrainHeight);
var tl = new PPos(1, 1);
var br = new PPos(width, height + maxTerrainHeight);
map.SetBounds(tl, br);
map.PlayerDefinitions = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length).ToMiniYaml();

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Widgets
actorSprite = new Sprite(radarSheet, new Rectangle(0, height, width, height), TextureChannel.Alpha);
// Set initial terrain data
foreach (var cell in world.Map.CellsInsideBounds)
foreach (var cell in world.Map.AllCells)
UpdateTerrainCell(cell);
world.Map.MapTiles.Value.CellEntryChanged += UpdateTerrainCell;
@@ -290,7 +290,7 @@ namespace OpenRA.Mods.Common.Widgets
if (newRenderShroud != null)
{
// Redraw the full shroud sprite
MarkShroudDirty(world.Map.CellsInsideBounds);
MarkShroudDirty(world.Map.AllCells);
// Update the notification binding
newRenderShroud.CellsChanged += MarkShroudDirty;