cleaned up compiler warnings
This commit is contained in:
@@ -94,7 +94,6 @@ namespace OpenRa
|
||||
// mapchooser
|
||||
Sheet mapChooserSheet;
|
||||
Sprite mapChooserSprite;
|
||||
Sprite colorBlock;
|
||||
int mapOffset = 0;
|
||||
|
||||
public Chrome(Renderer r)
|
||||
@@ -143,7 +142,6 @@ namespace OpenRa
|
||||
clock = new Animation("clock");
|
||||
|
||||
mapChooserSheet = new Sheet(r, new Size(128, 128));
|
||||
colorBlock = SheetBuilder.Add(new Size(65 - 8, 22 - 8), 0x54);
|
||||
}
|
||||
|
||||
List<string> visibleTabs = new List<string>();
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace OpenRa.Effects
|
||||
{
|
||||
class Missile : IEffect
|
||||
{
|
||||
readonly Player Owner;
|
||||
readonly Actor FiredBy;
|
||||
readonly WeaponInfo Weapon;
|
||||
readonly ProjectileInfo Projectile;
|
||||
@@ -47,7 +46,6 @@ namespace OpenRa.Effects
|
||||
Projectile = Rules.ProjectileInfo[Weapon.Projectile];
|
||||
Warhead = Rules.WarheadInfo[Weapon.Warhead];
|
||||
FiredBy = firedBy;
|
||||
Owner = owner;
|
||||
Target = target;
|
||||
Pos = src.ToFloat2();
|
||||
Altitude = altitude;
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace OpenRa.Graphics
|
||||
class Minimap
|
||||
{
|
||||
readonly World world;
|
||||
Sheet sheet, mapOnlySheet, mapSpawnPointSheet;
|
||||
Sheet sheet, mapOnlySheet;
|
||||
SpriteRenderer rgbaRenderer;
|
||||
LineRenderer lineRenderer;
|
||||
Sprite sprite, mapOnlySprite, mapSpawnPointSprite;
|
||||
Sprite sprite, mapOnlySprite;
|
||||
Bitmap terrain, oreLayer;
|
||||
Rectangle bounds;
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace OpenRa.Graphics
|
||||
this.world = world;
|
||||
sheet = new Sheet(r, new Size(128, 128));
|
||||
mapOnlySheet = new Sheet(r, new Size(128, 128));
|
||||
mapSpawnPointSheet = new Sheet(r, new Size(128, 128));
|
||||
|
||||
lineRenderer = new LineRenderer(r);
|
||||
rgbaRenderer = new SpriteRenderer(r, true, r.RgbaSpriteShader);
|
||||
@@ -61,7 +60,6 @@ namespace OpenRa.Graphics
|
||||
|
||||
sprite = new Sprite(sheet, bounds, TextureChannel.Alpha);
|
||||
mapOnlySprite = new Sprite(mapOnlySheet, bounds, TextureChannel.Alpha);
|
||||
mapSpawnPointSprite = new Sprite(mapSpawnPointSheet, bounds, TextureChannel.Alpha);
|
||||
|
||||
shroudColor = Color.FromArgb(alpha, Color.Black);
|
||||
|
||||
|
||||
@@ -158,7 +158,6 @@ namespace OpenRa.Graphics
|
||||
{
|
||||
using (new PerfSample("text"))
|
||||
{
|
||||
var size = MeasureText(text);
|
||||
Bitmap b = RenderTextToBitmap(text, fDebug, c);
|
||||
textSheet.Texture.SetData(b);
|
||||
rgbaRenderer.DrawSprite(textSprite, pos.ToFloat2(), "chrome");
|
||||
@@ -170,7 +169,6 @@ namespace OpenRa.Graphics
|
||||
{
|
||||
using (new PerfSample("text"))
|
||||
{
|
||||
var size = MeasureText2(text);
|
||||
Bitmap b = RenderTextToBitmap(text, fTitle, c);
|
||||
textSheet.Texture.SetData(b);
|
||||
rgbaRenderer.DrawSprite(textSprite, pos.ToFloat2(), "chrome");
|
||||
|
||||
@@ -97,13 +97,6 @@ namespace OpenRa
|
||||
}
|
||||
}
|
||||
|
||||
static Player LookupPlayer(World world, uint index)
|
||||
{
|
||||
return world.players
|
||||
.Where(x => x.Value.Index == index)
|
||||
.First().Value;
|
||||
}
|
||||
|
||||
public static Order Deserialize(World world, BinaryReader r)
|
||||
{
|
||||
switch (r.ReadByte())
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace OpenRa.Network
|
||||
{
|
||||
class OrderManager
|
||||
{
|
||||
Stream savingReplay;
|
||||
int frameNumber = 0;
|
||||
|
||||
public int FramesAhead = 0;
|
||||
@@ -36,7 +35,8 @@ namespace OpenRa.Network
|
||||
public bool GameStarted { get { return frameNumber != 0; } }
|
||||
public IConnection Connection { get; private set; }
|
||||
|
||||
Dictionary<int, Dictionary<int, byte[]>> frameClientData = new Dictionary<int, Dictionary<int, byte[]>>();
|
||||
Dictionary<int, Dictionary<int, byte[]>> frameClientData =
|
||||
new Dictionary<int, Dictionary<int, byte[]>>();
|
||||
List<int> readyForFrames = new List<int>();
|
||||
List<Order> localOrders = new List<Order>();
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace OpenRa.Network
|
||||
public OrderManager( IConnection conn, string replayFilename )
|
||||
: this( conn )
|
||||
{
|
||||
savingReplay = new FileStream( replayFilename, FileMode.Create );
|
||||
}
|
||||
|
||||
public void IssueOrders( Order[] orders )
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace OpenRa.Traits
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var attack = self.traits.Get<AttackBase>();
|
||||
var range = Util.GetMaximumRange(self);
|
||||
|
||||
if (NeedsNewTarget(self))
|
||||
|
||||
@@ -38,7 +38,6 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
public IActivity Tick( Actor self )
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
var mobile = self.traits.Get<Mobile>();
|
||||
|
||||
if( NextActivity != null )
|
||||
|
||||
@@ -27,9 +27,6 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
public IActivity Tick( Actor self )
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
var mobile = self.traits.Get<Mobile>();
|
||||
|
||||
if( isHarvesting ) return this;
|
||||
if( NextActivity != null ) return NextActivity;
|
||||
|
||||
@@ -49,7 +46,6 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
bool HarvestThisTile(Actor self)
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
var harv = self.traits.Get<Harvester>();
|
||||
var renderUnit = self.traits.Get<RenderUnit>(); /* better have one of these! */
|
||||
|
||||
|
||||
@@ -201,9 +201,6 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
public void TickMove( Actor self, Mobile mobile, Move parent )
|
||||
{
|
||||
var oldFraction = moveFraction;
|
||||
var oldTotal = moveFractionTotal;
|
||||
|
||||
moveFraction += (int)Util.GetEffectiveSpeed(self);
|
||||
if( moveFraction >= moveFractionTotal )
|
||||
moveFraction = moveFractionTotal;
|
||||
|
||||
@@ -27,10 +27,9 @@ namespace OpenRa.Traits.Activities
|
||||
{
|
||||
public IActivity NextActivity { get; set; }
|
||||
bool isCanceled;
|
||||
bool playHostAnim;
|
||||
int remainingTicks;
|
||||
|
||||
public Repair(bool playHostAnim) { this.playHostAnim = playHostAnim; }
|
||||
public Repair(bool playHostAnim) {}
|
||||
|
||||
public IActivity Tick(Actor self)
|
||||
{
|
||||
@@ -57,7 +56,8 @@ namespace OpenRa.Traits.Activities
|
||||
.FirstOrDefault(a => a.traits.Contains<RenderBuilding>());
|
||||
|
||||
if (hostBuilding != null)
|
||||
hostBuilding.traits.Get<RenderBuilding>().PlayCustomAnim(hostBuilding, "active");
|
||||
hostBuilding.traits.Get<RenderBuilding>()
|
||||
.PlayCustomAnim(hostBuilding, "active");
|
||||
|
||||
remainingTicks = (int)(Rules.General.RepairRate * 60 * 25);
|
||||
}
|
||||
|
||||
@@ -22,20 +22,14 @@ namespace OpenRa.Traits
|
||||
{
|
||||
public class CanPowerDownInfo : ITraitInfo
|
||||
{
|
||||
public object Create(Actor self) { return new CanPowerDown(self); }
|
||||
public object Create(Actor self) { return new CanPowerDown(); }
|
||||
}
|
||||
|
||||
public class CanPowerDown : IDisable, IPowerModifier, IResolveOrder
|
||||
{
|
||||
readonly Actor self;
|
||||
[Sync]
|
||||
bool IsDisabled = false;
|
||||
|
||||
public CanPowerDown(Actor self)
|
||||
{
|
||||
this.self = self;
|
||||
}
|
||||
|
||||
public bool Disabled
|
||||
{
|
||||
get { return IsDisabled; }
|
||||
|
||||
@@ -36,9 +36,9 @@ namespace OpenRa.Traits
|
||||
self.World.AddFrameEndTask(
|
||||
w =>
|
||||
{ /* create the free harvester! */
|
||||
var harvester = w.CreateActor("harv", self.Location + new int2(1, 2), self.Owner);
|
||||
var harvester = w.CreateActor("harv", self.Location
|
||||
+ new int2(1, 2), self.Owner);
|
||||
var unit = harvester.traits.Get<Unit>();
|
||||
var mobile = harvester.traits.Get<Mobile>();
|
||||
unit.Facing = 64;
|
||||
harvester.QueueActivity(new Harvest());
|
||||
});
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace OpenRa.Traits
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var b = self.GetBounds(false);
|
||||
if (isOpen && !self.World.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(((1/24f) * self.CenterLocation).ToInt2()).Any())
|
||||
if (isOpen && !self.World.WorldActor.traits.Get<UnitInfluence>()
|
||||
.GetUnitsAt(((1/24f) * self.CenterLocation).ToInt2()).Any())
|
||||
{
|
||||
isOpen = false;
|
||||
roof.PlayBackwardsThen(GetPrefix(self) + "build-top", () => roof.Play(GetPrefix(self) + "idle-top"));
|
||||
|
||||
@@ -71,8 +71,6 @@ namespace OpenRa.Traits
|
||||
// Pick the closed deploy direction to turn to
|
||||
if (self.traits.Contains<Unit>())
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
|
||||
// TODO: Pick the closest deploy direction
|
||||
var bestDir = info.DeployDirections[0];
|
||||
|
||||
|
||||
@@ -158,7 +158,6 @@ namespace OpenRa.Traits
|
||||
|
||||
public static float GetMaximumRange(Actor self)
|
||||
{
|
||||
var info = self.Info.Traits.Get<AttackBaseInfo>();
|
||||
return new[] { self.GetPrimaryWeapon(), self.GetSecondaryWeapon() }
|
||||
.Where(w => w != null).Max(w => w.Range);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace OpenRa.Traits
|
||||
public class UnitInfluence : ITick
|
||||
{
|
||||
List<Actor>[,] influence = new List<Actor>[128, 128];
|
||||
readonly int2 searchDistance = new int2(2,2);
|
||||
|
||||
public UnitInfluence( Actor self )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user