From 2fe3618b23d91456765bbfa4cc13cf1cc872e5de Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 3 Nov 2009 18:00:10 +1300 Subject: [PATCH] removed ScreenSpaceTurretOffset bs. if you want a screenspace offset, it's the 3rd and 4th elements of the PrimaryOffset / SecondaryOffset --- OpenRa.Game/GameRules/UnitInfo.cs | 1 - OpenRa.Game/Traits/Util.cs | 3 +-- units.ini | 20 +++++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/OpenRa.Game/GameRules/UnitInfo.cs b/OpenRa.Game/GameRules/UnitInfo.cs index 966e687eb4..420ca1811f 100755 --- a/OpenRa.Game/GameRules/UnitInfo.cs +++ b/OpenRa.Game/GameRules/UnitInfo.cs @@ -50,7 +50,6 @@ namespace OpenRa.Game.GameRules public readonly int[] PrimaryOffset = { 0, 0 }; public readonly int[] SecondaryOffset = null; public readonly int Recoil = 0; - public readonly int[] ScreenSpaceTurretOffset = { 0, 0 }; public UnitInfo(string name) { Name = name; } diff --git a/OpenRa.Game/Traits/Util.cs b/OpenRa.Game/Traits/Util.cs index f8912aeb93..14cdebbda3 100755 --- a/OpenRa.Game/Traits/Util.cs +++ b/OpenRa.Game/Traits/Util.cs @@ -88,8 +88,7 @@ namespace OpenRa.Game.Traits var quantizedFacing = bodyFacing - bodyFacing % ru.anim.CurrentSequence.Length; return (RotateVectorByFacing(new float2(offset[0], offset[1]), quantizedFacing, .7f) + GetRecoil(self, recoil)) - + new float2(self.unitInfo.ScreenSpaceTurretOffset[0], - self.unitInfo.ScreenSpaceTurretOffset[1]); + + new float2(offset.ElementAtOrDefault(2), offset.ElementAtOrDefault(3)); } public static Pair Centered(Sprite s, float2 location) diff --git a/units.ini b/units.ini index ea0de5cf30..4573abaaa9 100755 --- a/units.ini +++ b/units.ini @@ -34,13 +34,11 @@ Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted [MRJ] Description=Radar Jammer Traits=Mobile, RenderUnitTurreted -PrimaryOffset=0,4 -ScreenSpaceTurretOffset=0,-6 +PrimaryOffset=0,4,0,-6 [MGG] Description=Mobile Gap Generator Traits=Mobile, RenderUnitTurreted -PrimaryOffset=0,6 -ScreenSpaceTurretOffset=0,-3 +PrimaryOffset=0,6,0,-3 [ARTY] Description=Artillery Traits=Mobile, RenderUnit @@ -53,7 +51,7 @@ Traits=Mobile, McvDeploy, RenderUnit [JEEP] Description=Ranger Traits=Mobile, Turreted, AttackTurreted, RenderUnitTurreted -ScreenSpaceTurretOffset=0,-2 +PrimaryOffset=0,0,0,-2 [APC] Description=Armored Personnel Carrier Traits=Mobile, RenderUnit @@ -87,8 +85,8 @@ Description=Cruiser WaterBound=yes BuiltAt=syrd Traits=Mobile, Turreted, RenderUnitTurreted, AttackTurreted -PrimaryOffset=0,17 -SecondaryOffset=0,-17 +PrimaryOffset=0,17,0,-2 +SecondaryOffset=0,-17,0,-2 Recoil=3 [LST] Description=Transport @@ -124,8 +122,8 @@ BuiltAt=afld Traits=Mobile, RenderUnit [TRAN] Description=Transport Helicopter -PrimaryOffset=0,14 -SecondaryOffset=0,-14 +PrimaryOffset=0,14,0,-4 +SecondaryOffset=0,-14,0,-2 BuiltAt=hpad Traits=Mobile, RenderUnitRotor [HELI] @@ -201,8 +199,8 @@ Footprint=xx xx [PDOX] Description=Chronosphere Traits=Building, RenderBuilding -Dimensions=2,1 -Footprint=xx +Dimensions=2,2 +Footprint=xx xx [WEAP] Description=War Factory Traits=Building, RenderWarFactory