From 85056e1c6c5f6b2d85ba613b1de1e87af85ffd9d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 16 May 2013 00:35:09 +1200 Subject: [PATCH] Convert bridges to world coordinates. --- OpenRA.Game/CPos.cs | 2 ++ OpenRA.Mods.RA/Bridge.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index 832aab7998..02e117c220 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -43,6 +43,8 @@ namespace OpenRA public int2 ToInt2() { return new int2(X, Y); } public PPos ToPPos() { return new PPos(Game.CellSize * X, Game.CellSize * Y); } + public WPos CenterPosition { get { return new WPos(1024*X + 512, 1024*Y + 512, 0); } } + public CPos Clamp(Rectangle r) { return new CPos(Math.Min(r.Right, Math.Max(X, r.Left)), diff --git a/OpenRA.Mods.RA/Bridge.cs b/OpenRA.Mods.RA/Bridge.cs index f8d78a43d5..c3b4425594 100644 --- a/OpenRA.Mods.RA/Bridge.cs +++ b/OpenRA.Mods.RA/Bridge.cs @@ -151,7 +151,7 @@ namespace OpenRA.Mods.RA } foreach (var t in TileSprites[currentTemplate]) - yield return new SpriteRenderable(t.Value, Traits.Util.CenterOfCell(t.Key).ToFloat2(), terrainPalette, Game.CellSize * t.Key.Y); + yield return new SpriteRenderable(t.Value, t.Key.CenterPosition, 0, terrainPalette, 1f); } void KillUnitsOnBridge()