# HG changeset patch # User smxx # Date 1266939697 0 # Node ID c6dff591f5647616591a22887d3742fcf1e220dc # Parent a9a5ce1d9f23b9cab961a7ea01232213d0450dc4 Engine: * Added step sounds for hedgehogs (needs some tweaking after jumps) diff -r a9a5ce1d9f23 -r c6dff591f564 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Tue Feb 23 03:57:27 2010 +0000 +++ b/hedgewars/uConsts.pas Tue Feb 23 15:41:37 2010 +0000 @@ -106,7 +106,7 @@ sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter, sndHomerun, sndMolotov, sndWalking, sndCover, sndUhOh, sndOops, sndNooo, sndHello, sndRopeShot, sndRopeAttach, - sndRopeRelease, sndSwitchHog, sndVictory, sndSniperReload); + sndRopeRelease, sndSwitchHog, sndVictory, sndSniperReload, sndSteps); TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer, amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, @@ -758,7 +758,8 @@ (FileName: ''; Path: ptSounds),// sndRopeRelease (FileName: 'switchhog.ogg'; Path: ptSounds),// sndSwitchHog (FileName: 'victory.ogg'; Path: ptVoices),// sndVictory - (FileName: 'sniperreload.ogg'; Path: ptSounds) // sndSniperReload + (FileName: 'sniperreload.ogg'; Path: ptSounds),// sndSniperReload + (FileName: 'steps.ogg'; Path: ptSounds) // sndSteps ); Ammoz: array [TAmmoType] of record diff -r a9a5ce1d9f23 -r c6dff591f564 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Feb 23 03:57:27 2010 +0000 +++ b/hedgewars/uGears.pas Tue Feb 23 15:41:37 2010 +0000 @@ -847,8 +847,10 @@ hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction lx, ly, dx, dy, ax, ay, aAngle, dAngle, hAngle: real; // laser, change defaultPos, HatVisible: boolean; - VertexBuffer: array [0..1] of TVertex2f; + VertexBuffer: array [0..1] of TVertex2f; + stepSounds: boolean; begin + if PHedgehog(Gear^.Hedgehog)^.Unplaced then exit; m:= 1; if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; @@ -860,6 +862,7 @@ defaultPos:= true; HatVisible:= false; +stepSounds:= false; sx:= hwRound(Gear^.X) + 1 + WorldDx; sy:= hwRound(Gear^.Y) - 3 + WorldDy; @@ -1025,6 +1028,7 @@ 3, PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, 0); + stepSounds:= true; defaultPos:= false end; gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180); @@ -1121,6 +1125,7 @@ 0, PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, 0); + stepSounds:= true; defaultPos:= false; HatVisible:= true end @@ -1363,6 +1368,14 @@ DrawSprite(sprVampiric, sx - 24, sy - 24, 0); glColor4f(1, 1, 1, 1); end; + + if stepSounds and (Gear^.SoundChannel < 0) then + Gear^.SoundChannel:= LoopSound(sndSteps) + else if not stepSounds and (Gear^.SoundChannel > -1) then + begin + StopSound(Gear^.SoundChannel); + Gear^.SoundChannel:= -1; + end; end; procedure DrawRopeLinesRQ(Gear: PGear); diff -r a9a5ce1d9f23 -r c6dff591f564 share/hedgewars/Data/Sounds/steps.ogg Binary file share/hedgewars/Data/Sounds/steps.ogg has changed