New types for cell and pixel coordinate position/vectors.

This commit is contained in:
James Dunne
2012-06-20 23:22:27 -05:00
parent 0b98a8ce5e
commit 9c49143534
162 changed files with 1291 additions and 865 deletions

View File

@@ -19,13 +19,13 @@ namespace OpenRA.Mods.RA.Effects
{
readonly Player firedBy;
Animation anim;
int2 pos;
int2 targetLocation;
PPos pos;
CPos targetLocation;
int altitude;
bool goingUp = true;
string weapon;
public NukeLaunch(Player firedBy, Actor silo, string weapon, int2 spawnOffset, int2 targetLocation)
public NukeLaunch(Player firedBy, Actor silo, string weapon, PVecInt spawnOffset, CPos targetLocation)
{
this.firedBy = firedBy;
this.targetLocation = targetLocation;
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.RA.Effects
{
world.AddFrameEndTask(w => w.Remove(this));
Combat.DoExplosion(firedBy.PlayerActor, weapon, pos, 0);
world.WorldActor.Trait<ScreenShaker>().AddEffect(20, pos, 5);
world.WorldActor.Trait<ScreenShaker>().AddEffect(20, pos.ToFloat2(), 5);
foreach (var a in world.ActorsWithTrait<NukePaletteEffect>())
a.Trait.Enable();
@@ -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.ToFloat2() - 0.5f * anim.Image.size - new float2(0, altitude),
"effect", (int)pos.Y);
}
}