Pass WorldRenderer to AnimationWithOffset.OffsetFunc.

This commit is contained in:
Paul Chote
2013-03-31 19:56:11 +13:00
parent 7c21459b48
commit 2f80cd5f92
12 changed files with 16 additions and 16 deletions

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA
var anim = new Animation("fire", () => 0);
anim.PlayRepeating(Info.Anim);
rs.anims.Add("fire",
new AnimationWithOffset(anim, () => new float2(0, -3), null));
new AnimationWithOffset(anim, wr => new float2(0, -3), null));
}
public void Tick(Actor self)

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Render
anim.Play("turret");
anims.Add("turret_{0}".F(i++), new AnimationWithOffset(anim,
() => PPos.FromWPosHackZ(WPos.Zero + t.Position(self)).ToFloat2(), null));
wr => PPos.FromWPosHackZ(WPos.Zero + t.Position(self)).ToFloat2(), null));
}
}
}

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Render
var turret = new Turret(info.Offset);
anims.Add("spinner", new AnimationWithOffset(
spinnerAnim,
() => turret.PxPosition(self, facing).ToFloat2(),
wr => turret.PxPosition(self, facing).ToFloat2(),
null ) { ZOffset = 1 } );
}
}

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Render
anim.Play("turret");
anims.Add("turret_{0}".F(i++), new AnimationWithOffset(anim,
() => TurretPosition(self, turret, facing), null));
wr => TurretPosition(self, turret, facing), null));
}
}

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Render
muzzleFlashes.Add("muzzle{0}".F(muzzleFlashes.Count), new AnimationWithOffset(
muzzleFlash,
() => PPos.FromWPosHackZ(WPos.Zero + a.MuzzleOffset(self, barrel)).ToFloat2(),
wr => PPos.FromWPosHackZ(WPos.Zero + a.MuzzleOffset(self, barrel)).ToFloat2(),
() => !isShowing));
}
}
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.RA.Render
{
foreach (var a in muzzleFlashes.Values)
if (a.DisableFunc == null || !a.DisableFunc())
yield return a.Image(self, wr.Palette("effect"));
yield return a.Image(self, wr, wr.Palette("effect"));
}
public void Tick(Actor self)

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Render
var turret = new Turret(info.Offset);
rs.anims.Add(info.Id, new AnimationWithOffset(
rotorAnim,
() => turret.PxPosition(self, facing).ToFloat2(),
wr => turret.PxPosition(self, facing).ToFloat2(),
null ) { ZOffset = 1 } );
}

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
anim.PlayRepeating(info.Anim);
ru.anims.Add(info.AnimKey, new AnimationWithOffset(
anim, () => pos - new float2(0, alt), null));
anim, wr => pos - new float2(0, alt), null));
}
public void Tick(Actor self)