fix trailing whitespace everywhere

This commit is contained in:
Chris Forbes
2011-09-25 14:37:12 +13:00
parent 0eb98ef3b5
commit 55036cd58c
596 changed files with 3194 additions and 3194 deletions

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Effects
{
readonly BulletInfo Info;
readonly ProjectileArgs Args;
int t = 0;
Animation anim;
@@ -92,8 +92,8 @@ namespace OpenRA.Mods.RA.Effects
var u = (rawFacing % 128) / 128f;
var scale = 512 * u * (1 - u);
return (int)(rawFacing < 128
? rawFacing - scale * attitude
return (int)(rawFacing < 128
? rawFacing - scale * attitude
: rawFacing + scale * attitude);
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.RA.Effects
{
anim.Tick();
}
public IEnumerable<Renderable> Render()
{
if (a.IsInWorld)

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -34,8 +34,8 @@ namespace OpenRA.Mods.RA.Effects
public IEnumerable<Renderable> Render()
{
yield return new Renderable(anim.Image,
pos - .5f * anim.Image.size - new int2(0,altitude),
yield return new Renderable(anim.Image,
pos - .5f * anim.Image.size - new int2(0,altitude),
"effect", (int)pos.Y - altitude);
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Effects
if (self.Destroyed)
world.AddFrameEndTask(w => w.Remove(this));
if (world.LocalPlayer == null)
return;

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -31,11 +31,11 @@ namespace OpenRA.Mods.RA.Effects
{
anim.Tick();
offset.Y -= heightPerTick;
if (offset.Y < 0)
world.AddFrameEndTask(w => w.Remove(this));
}
public IEnumerable<Renderable> Render()
{
yield return new Renderable(anim.Image,offset, "effect", (int)offset.Y);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA.Effects
public IEnumerable<Renderable> Render()
{
yield return new Renderable(anim.Image,
yield return new Renderable(anim.Image,
Args.dest - new int2(0, altitude) - .5f * anim.Image.size, "effect", Args.dest.Y);
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Effects
public readonly Color Color = Color.Red;
public readonly string Explosion = "laserfire";
public IEffect Create(ProjectileArgs args)
public IEffect Create(ProjectileArgs args)
{
var c = UsePlayerColor ? args.firedBy.Owner.ColorRamp.GetColor(0) : Color;
return new LaserZap(args, this, c);
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Effects
Color color;
bool doneDamage;
Animation explosion;
public LaserZap(ProjectileArgs args, LaserZapInfo info, Color color)
{
this.args = args;

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Effects
int2 offset;
public int2 SubPxPosition;
public int2 PxPosition { get { return new int2( SubPxPosition.X / 1024, SubPxPosition.Y / 1024 ); } }
readonly Animation anim;
int Facing;
int t;
@@ -81,24 +81,24 @@ namespace OpenRA.Mods.RA.Effects
Info.ContrailDelay);
}
}
// In pixels
const int MissileCloseEnough = 7;
int ticksToNextSmoke;
public void Tick( World world )
{
t += 40;
// In pixels
var dist = Args.target.CenterLocation + offset - PxPosition;
var targetAltitude = 0;
if (Args.target.IsValid && Args.target.IsActor && Args.target.Actor.HasTrait<IMove>())
targetAltitude = Args.target.Actor.Trait<IMove>().Altitude;
Altitude += Math.Sign(targetAltitude - Altitude);
Facing = Traits.Util.TickFacing(Facing,
Traits.Util.GetFacing(dist, Facing),
Info.ROT);
@@ -107,15 +107,15 @@ namespace OpenRA.Mods.RA.Effects
if (dist.LengthSquared < MissileCloseEnough * MissileCloseEnough || !Args.target.IsValid )
Explode(world);
// TODO: Replace this with a lookup table
var dir = (-float2.FromAngle((float)(Facing / 128f * Math.PI))*1024).ToInt2();
var move = Info.Speed * dir;
if (targetAltitude > 0 && Info.TurboBoost)
move = (move * 3) / 2;
move = move / 5;
SubPxPosition += move;
if (Info.Trail != null)
@@ -128,7 +128,7 @@ namespace OpenRA.Mods.RA.Effects
ticksToNextSmoke = Info.TrailInterval;
}
}
if (Info.RangeLimit != 0 && t > Info.RangeLimit * 40)
Explode(world);
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.RA.Effects
public IEnumerable<Renderable> Render()
{
if (Args.firedBy.World.LocalShroud.IsVisible(OpenRA.Traits.Util.CellContaining(PxPosition.ToFloat2())))
yield return new Renderable(anim.Image,PxPosition.ToFloat2() - 0.5f * anim.Image.size - new float2(0, Altitude),
yield return new Renderable(anim.Image,PxPosition.ToFloat2() - 0.5f * anim.Image.size - new float2(0, Altitude),
Args.weapon.Underwater ? "shadow" : "effect", PxPosition.Y);
if (Trail != null)

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Effects
this.weapon = weapon;
anim = new Animation(weapon);
anim.PlayRepeating("up");
if (silo == null)
{
altitude = firedBy.World.Map.Bounds.Height*Game.CellSize;
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.RA.Effects
anim.PlayRepeating("down");
goingUp = false;
}
public void Tick(World world)
{
anim.Tick();
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.RA.Effects
public IEnumerable<Renderable> Render()
{
yield return new Renderable(anim.Image, pos - 0.5f * anim.Image.size - new float2(0, altitude),
yield return new Renderable(anim.Image, pos - 0.5f * anim.Image.size - new float2(0, altitude),
"effect", (int)pos.Y);
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Effects
readonly string palette;
readonly Animation paraAnim;
readonly float2 location;
readonly Actor cargo;
int2 offset;
@@ -38,24 +38,24 @@ namespace OpenRA.Mods.RA.Effects
var rs = cargo.Trait<RenderSimple>();
var image = rs.anim.Name;
palette = rs.Palette(owner);
anim = new Animation(image);
if (anim.HasSequence("idle"))
anim.PlayFetchIndex("idle", () => 0);
else
anim.PlayFetchIndex("stand", () => 0);
anim.Tick();
var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
if (pai != null) offset = pai.Offset;
}
public void Tick(World world)
{
{
paraAnim.Tick();
altitude -= fallRate;

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -22,9 +22,9 @@ namespace OpenRA.Mods.RA.Effects
RA.RallyPoint rp;
public Animation flag = new Animation("rallypoint");
public Animation circles = new Animation("rallypoint");
public RallyPoint(Actor building)
{
public RallyPoint(Actor building)
{
this.building = building;
rp = building.Trait<RA.RallyPoint>();
flag.PlayRepeating("flag");
@@ -41,25 +41,25 @@ namespace OpenRA.Mods.RA.Effects
cachedLocation = rp.rallyPoint;
circles.Play("circles");
}
if (!building.IsInWorld || building.IsDead())
world.AddFrameEndTask(w => w.Remove(this));
}
public IEnumerable<Renderable> Render()
{
if (building.IsInWorld && building.Owner == building.World.LocalPlayer
if (building.IsInWorld && building.Owner == building.World.LocalPlayer
&& building.World.Selection.Actors.Contains(building))
{
var pos = Traits.Util.CenterOfCell(rp.rallyPoint);
var palette = building.Trait<RenderSimple>().Palette(building.Owner);
yield return new Renderable(circles.Image,
pos - .5f * circles.Image.size,
yield return new Renderable(circles.Image,
pos - .5f * circles.Image.size,
palette, (int)pos.Y);
yield return new Renderable(flag.Image,
pos + new float2(-1,-17),
yield return new Renderable(flag.Image,
pos + new float2(-1,-17),
palette, (int)pos.Y);
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -26,20 +26,20 @@ namespace OpenRA.Mods.RA.Effects
{
doors.PlayThen("active",
() => a.World.AddFrameEndTask(w => w.Remove(this)));
pos = a.CenterLocation - .5f * doors.Image.size + doorOffset;
}
public void Tick( World world )
{
doors.Tick();
if (++frame == 19)
{
world.AddFrameEndTask(w => w.Add(new GpsSatellite(pos)));
}
}
public IEnumerable<Renderable> Render()
{
yield return new Renderable(doors.Image, pos, "effect", (int)doorOffset.Y);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -115,8 +115,8 @@ namespace OpenRA.Mods.RA.Effects
return rs;
}
static int[][] steps = new []
{
static int[][] steps = new []
{
new int[] { 8, 8, -8, -8, 0 },
new int[] { -8, -8, -16, -16, 0 },
new int[] { 8, 0, -8, -8, 1 },