diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index 23dedcdae6..9377121eb3 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -49,7 +49,7 @@ namespace OpenRA public MPos ToMPos(MapGridType gridType) { - if (gridType == MapGridType.Rectangle) + if (gridType == MapGridType.Rectangular) return new MPos(X, Y); // Convert from diamond cell (x, y) position to rectangular map position (u, v) diff --git a/OpenRA.Game/Graphics/Theater.cs b/OpenRA.Game/Graphics/Theater.cs index 02c2edaf84..5f0e37fcfa 100644 --- a/OpenRA.Game/Graphics/Theater.cs +++ b/OpenRA.Game/Graphics/Theater.cs @@ -125,8 +125,8 @@ namespace OpenRA.Graphics continue; var sprite = TileSprite(tile); - var u = mapGrid == MapGridType.Rectangle ? x : (x - y) / 2f; - var v = mapGrid == MapGridType.Rectangle ? y : (x + y) / 2f; + var u = mapGrid == MapGridType.Rectangular ? x : (x - y) / 2f; + var v = mapGrid == MapGridType.Rectangular ? y : (x + y) / 2f; var tl = new float2(u * tileSize.Width, (v - 0.5f * tileInfo.Height) * tileSize.Height) - 0.5f * sprite.Size; var rect = new Rectangle((int)(tl.X + sprite.Offset.X), (int)(tl.Y + sprite.Offset.Y), (int)sprite.Size.X, (int)sprite.Size.Y); diff --git a/OpenRA.Game/MPos.cs b/OpenRA.Game/MPos.cs index 90968c3f60..7ec7e7c519 100644 --- a/OpenRA.Game/MPos.cs +++ b/OpenRA.Game/MPos.cs @@ -43,7 +43,7 @@ namespace OpenRA public CPos ToCPos(MapGridType gridType) { - if (gridType == MapGridType.Rectangle) + if (gridType == MapGridType.Rectangular) return new CPos(U, V); // Convert from rectangular map position to diamond cell position diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index a7bebe43c1..74bb9364e3 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -786,7 +786,7 @@ namespace OpenRA public WPos CenterOfCell(CPos cell) { - if (Grid.Type == MapGridType.Rectangle) + if (Grid.Type == MapGridType.Rectangular) return new WPos(1024 * cell.X + 512, 1024 * cell.Y + 512, 0); // Convert from diamond cell position (x, y) to world position (u, v): @@ -818,7 +818,7 @@ namespace OpenRA public CPos CellContaining(WPos pos) { - if (Grid.Type == MapGridType.Rectangle) + if (Grid.Type == MapGridType.Rectangular) return new CPos(pos.X / 1024, pos.Y / 1024); // Convert from world position to diamond cell position: diff --git a/OpenRA.Game/Map/MapGrid.cs b/OpenRA.Game/Map/MapGrid.cs index 09be0ac32b..2e879d6994 100644 --- a/OpenRA.Game/Map/MapGrid.cs +++ b/OpenRA.Game/Map/MapGrid.cs @@ -13,11 +13,11 @@ using System.IO; namespace OpenRA { - public enum MapGridType { Rectangle, Diamond } + public enum MapGridType { Rectangular, Diamond } public class MapGrid : IGlobalModData { - public readonly MapGridType Type = MapGridType.Rectangle; + public readonly MapGridType Type = MapGridType.Rectangular; public readonly Size TileSize = new Size(24, 24); public readonly byte MaximumTerrainHeight = 0; public readonly byte SubCellDefaultIndex = byte.MaxValue; diff --git a/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs b/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs index b9752c022e..70bf4aa7bc 100644 --- a/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs +++ b/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs @@ -90,8 +90,8 @@ namespace OpenRA.Mods.Common.Widgets var sprite = worldRenderer.Theater.TileSprite(tile, 0); var size = new float2(sprite.Size.X * scale, sprite.Size.Y * scale); - var u = gridType == MapGridType.Rectangle ? x : (x - y) / 2f; - var v = gridType == MapGridType.Rectangle ? y : (x + y) / 2f; + var u = gridType == MapGridType.Rectangular ? x : (x - y) / 2f; + var v = gridType == MapGridType.Rectangular ? y : (x + y) / 2f; var pos = origin + scale * (new float2(u * ts.Width, (v - 0.5f * tileInfo.Height) * ts.Height) - 0.5f * sprite.Size); Game.Renderer.SpriteRenderer.DrawSprite(sprite, pos, worldRenderer.Palette(Palette), size); } diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 47669e350d..57c2ac67b3 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -207,7 +207,7 @@ Missions: MapGrid: TileSize: 24,24 - Type: Rectangle + Type: Rectangular SupportsMapsFrom: cnc diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 047b0290c9..26cf75cf8c 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -51,7 +51,7 @@ TileSets: MapGrid: TileSize: 32,32 - Type: Rectangle + Type: Rectangular Cursors: ./mods/d2k/cursors.yaml diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index c6e64603d6..31b4148707 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -207,7 +207,7 @@ Missions: MapGrid: TileSize: 24,24 - Type: Rectangle + Type: Rectangular SupportsMapsFrom: ra