# HG changeset patch # User sheepluva # Date 1277710390 -7200 # Node ID 85bd667955f24dd19cdd31e0c5395c4bf10c32cf # Parent 00aac66147c83d1c0071485c0eb76a03bdc9afdc engine: apply weapon offset to charge animation diff -r 00aac66147c8 -r 85bd667955f2 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Jun 28 08:52:17 2010 +0200 +++ b/hedgewars/uGears.pas Mon Jun 28 09:33:10 2010 +0200 @@ -95,6 +95,8 @@ procedure RemoveGearFromList(Gear: PGear); function ModifyDamage(dmg: Longword; Gear: PGear): Longword; procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt); +function GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt; +function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt; implementation uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics, diff -r 00aac66147c8 -r 85bd667955f2 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Mon Jun 28 08:52:17 2010 +0200 +++ b/hedgewars/uWorld.pas Mon Jun 28 09:33:10 2010 +0200 @@ -612,8 +612,8 @@ tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle); for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do DrawSprite(sprPower, - hwRound(Gear^.X) + round(WorldDx + tdx * (24 + i * 2)) - 16, - hwRound(Gear^.Y) + round(WorldDy + tdy * (24 + i * 2)) - 12, + hwRound(Gear^.X) + GetLaunchX(Ammo^[CurSlot, CurAmmo].AmmoType, hwSign(Gear^.dX), Gear^.Angle) + round(WorldDx + tdx * (24 + i * 2)) - 16, + hwRound(Gear^.Y) + GetLaunchY(Ammo^[CurSlot, CurAmmo].AmmoType, Gear^.Angle) + round(WorldDy + tdy * (24 + i * 2)) - 16, i) end end;