hedgewars/PascalExports.pas
changeset 3668 3f7a95234d8a
parent 3662 a44406f4369b
child 3672 f225b94a4411
--- a/hedgewars/PascalExports.pas	Sat Jul 24 23:23:10 2010 +0200
+++ b/hedgewars/PascalExports.pas	Sun Jul 25 01:59:41 2010 +0200
@@ -13,14 +13,13 @@
 unit PascalExports;
 
 interface
-uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, hwengine;
+uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, uSound, hwengine;
 
 {$INCLUDE "config.inc"}
 
 implementation
 
 {$IFDEF HWLIBRARY}
-var xx, yy: LongInt;
 
 // retrieve protocol information
 procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
@@ -170,18 +169,24 @@
     y^:= CursorPoint.Y;
 end;
 
-procedure HW_saveCursor(reset: boolean); cdecl; export;
+procedure HW_setPianoSound(snd: LongInt); cdecl; export;
+var CurSlot, CurAmmo: LongWord;
 begin
-    if reset then
-    begin
-        CursorPoint.X:= xx;
-        CursorPoint.Y:= yy;
-    end
-    else
-    begin
-        xx:= CursorPoint.X;
-        yy:= CursorPoint.Y;
-    end;
+    CurSlot:= CurrentHedgehog^.CurSlot;
+    CurAmmo:= CurrentHedgehog^.CurAmmo;
+    // this most likely won't work in network game
+    if (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amPiano) then
+        case snd of 
+            0: PlaySound(sndPiano0);
+            1: PlaySound(sndPiano1);
+            2: PlaySound(sndPiano2);
+            3: PlaySound(sndPiano3);
+            4: PlaySound(sndPiano4);
+            5: PlaySound(sndPiano5);
+            6: PlaySound(sndPiano6);
+            7: PlaySound(sndPiano7);
+            else PlaySound(sndPiano8);
+        end;
 end;
 
 function HW_isAmmoOpen: boolean; cdecl; export;
@@ -213,6 +218,11 @@
         exit(false)
 end;
 
+function HW_isPaused: boolean; cdecl; export;
+begin
+    exit( isPaused );
+end;
+
 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
 begin
     ParseCommand('/timer ' + inttostr(time), true);