From 43ad339ffea386a901dcfd743269a8e88f194481 Mon Sep 17 00:00:00 2001 From: alzeih Date: Fri, 14 May 2010 01:00:28 +1200 Subject: [PATCH] Squelch almost all compile errors --- OpenRA.FileFormats/Map/Map.cs | 3 ++- OpenRA.Game/PathSearch.cs | 4 ++-- OpenRA.Game/Traits/Modifiers/WithMuzzleFlash.cs | 4 ++-- OpenRA.Game/Traits/Player/ConquestVictoryConditions.cs | 2 +- OpenRA.Game/Traits/Render/RenderBuildingWall.cs | 4 ++-- OpenRA.Game/Traits/Repairable.cs | 4 ++-- OpenRA.Game/Widgets/BuildPaletteWidget.cs | 10 +++++----- OpenRA.Game/World.cs | 6 +++--- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/OpenRA.FileFormats/Map/Map.cs b/OpenRA.FileFormats/Map/Map.cs index 2c6c1c3778..04bc97b51b 100644 --- a/OpenRA.FileFormats/Map/Map.cs +++ b/OpenRA.FileFormats/Map/Map.cs @@ -157,8 +157,9 @@ namespace OpenRA.FileFormats { using (var dataStream = Package.GetContent("map.bin")) { + //byte version = + ReadByte(dataStream); // Load header info - byte version = ReadByte(dataStream); var width = ReadWord(dataStream); var height = ReadWord(dataStream); diff --git a/OpenRA.Game/PathSearch.cs b/OpenRA.Game/PathSearch.cs index 7bf840f93c..59c7d1e1d2 100755 --- a/OpenRA.Game/PathSearch.cs +++ b/OpenRA.Game/PathSearch.cs @@ -30,7 +30,7 @@ namespace OpenRA public class PathSearch { World world; - ResourceLayer resources; + //ResourceLayer resources; public CellInfo[ , ] cellInfo; public PriorityQueue queue; public Func heuristic; @@ -51,7 +51,7 @@ namespace OpenRA buildingInfluence = world.WorldActor.traits.Get(); unitInfluence = world.WorldActor.traits.Get(); - resources = world.WorldActor.traits.Get(); + //resources = world.WorldActor.traits.Get(); } public PathSearch InReverse() diff --git a/OpenRA.Game/Traits/Modifiers/WithMuzzleFlash.cs b/OpenRA.Game/Traits/Modifiers/WithMuzzleFlash.cs index 646dd80e76..d184b20837 100644 --- a/OpenRA.Game/Traits/Modifiers/WithMuzzleFlash.cs +++ b/OpenRA.Game/Traits/Modifiers/WithMuzzleFlash.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * This file is part of OpenRA. @@ -40,7 +40,7 @@ namespace OpenRA.Traits muzzleFlash = new Animation(render.GetImage(self), () => unit.Facing); muzzleFlash.Play("muzzle"); - var len = muzzleFlash.CurrentSequence.Length; + //var len = muzzleFlash.CurrentSequence.Length; render.anims.Add("muzzle", new RenderSimple.AnimationWithOffset( muzzleFlash, diff --git a/OpenRA.Game/Traits/Player/ConquestVictoryConditions.cs b/OpenRA.Game/Traits/Player/ConquestVictoryConditions.cs index e3c254032a..b4e3a2beb5 100644 --- a/OpenRA.Game/Traits/Player/ConquestVictoryConditions.cs +++ b/OpenRA.Game/Traits/Player/ConquestVictoryConditions.cs @@ -36,7 +36,7 @@ namespace OpenRA.Traits public void Tick(Actor self) { - var info = self.Info.Traits.Get(); + //var info = self.Info.Traits.Get(); var hasAnything = self.World.Queries.OwnedBy[self.Owner] .WithTrait().Any(); diff --git a/OpenRA.Game/Traits/Render/RenderBuildingWall.cs b/OpenRA.Game/Traits/Render/RenderBuildingWall.cs index 0d069f8b57..57d55809f4 100644 --- a/OpenRA.Game/Traits/Render/RenderBuildingWall.cs +++ b/OpenRA.Game/Traits/Render/RenderBuildingWall.cs @@ -33,14 +33,14 @@ namespace OpenRA.Traits { string seqName; int damageStates; - Actor self; + //Actor self; int adjacentWalls = 0; public RenderBuildingWall(Actor self) : base(self) { seqName = "idle"; - this.self = self; + //this.self = self; this.damageStates = self.Info.Traits.Get().DamageStates; anim.PlayFetchIndex(seqName, () => adjacentWalls); diff --git a/OpenRA.Game/Traits/Repairable.cs b/OpenRA.Game/Traits/Repairable.cs index e89a87b0ac..3ed2c1c1ec 100644 --- a/OpenRA.Game/Traits/Repairable.cs +++ b/OpenRA.Game/Traits/Repairable.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * This file is part of OpenRA. @@ -44,7 +44,7 @@ namespace OpenRA.Traits if (order.OrderString == "Enter") { - var res = order.TargetActor.traits.GetOrDefault(); + //var res = order.TargetActor.traits.GetOrDefault(); var rp = order.TargetActor.traits.GetOrDefault(); self.CancelActivity(); diff --git a/OpenRA.Game/Widgets/BuildPaletteWidget.cs b/OpenRA.Game/Widgets/BuildPaletteWidget.cs index e8a213929c..64a1144ee9 100644 --- a/OpenRA.Game/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Game/Widgets/BuildPaletteWidget.cs @@ -222,7 +222,7 @@ namespace OpenRA.Widgets // Icons string tooltipItem = null; - float2 tooltipPos = float2.Zero; + //float2 tooltipPos = float2.Zero; foreach (var item in allBuildables) { var rect = new RectangleF(origin.X + x * 64, origin.Y + 48 * y, 64, 48); @@ -235,7 +235,7 @@ namespace OpenRA.Widgets if (rect.Contains(Game.chrome.lastMousePos.ToPoint())) { tooltipItem = item.Name; - tooltipPos = drawPos; + //tooltipPos = drawPos; } var overlayPos = drawPos + new float2((64 - ready.Image.size.X) / 2, 2); @@ -470,7 +470,7 @@ namespace OpenRA.Widgets void DrawProductionTooltip(World world, string unit, int2 pos) { pos.Y += 15; - var chromeCollection = "chrome-" + world.LocalPlayer.Country.Race; + //var chromeCollection = "chrome-" + world.LocalPlayer.Country.Race; var p = pos.ToFloat2() - new float2(297, -3); @@ -534,8 +534,8 @@ namespace OpenRA.Widgets int size = p.visibleTabs.Count(); if (size > 0) { - string last = p.visibleTabs.Last(); - string first = p.visibleTabs.First(); + //string last = p.visibleTabs.Last(); + //string first = p.visibleTabs.First(); int current = p.visibleTabs.IndexOf(p.currentTab); if (!shift) { diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 42b22d7143..7e16b1cf3b 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -138,15 +138,15 @@ namespace OpenRA public void Tick() { - var sw = new Stopwatch(); + //var sw = new Stopwatch(); foreach (var a in actors) a.Tick(); Queries.WithTraitMultiple().Do( x => { - var t = sw.ElapsedTime(); + //var t = sw.ElapsedTime(); x.Trait.Tick( x.Actor ); - var dt = sw.ElapsedTime() - t; + //var dt = sw.ElapsedTime() - t; // if( dt > 0.001 ) // Log.Write( "expensive tick: {0}->{1}", x.Actor.Info.Name, x.Trait.GetType() ); } );