hedgewars/PascalExports.pas
changeset 3668 3f7a95234d8a
parent 3662 a44406f4369b
child 3672 f225b94a4411
equal deleted inserted replaced
3667:9359a70df013 3668:3f7a95234d8a
    11 {$INCLUDE "options.inc"}
    11 {$INCLUDE "options.inc"}
    12 
    12 
    13 unit PascalExports;
    13 unit PascalExports;
    14 
    14 
    15 interface
    15 interface
    16 uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, hwengine;
    16 uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, uSound, hwengine;
    17 
    17 
    18 {$INCLUDE "config.inc"}
    18 {$INCLUDE "config.inc"}
    19 
    19 
    20 implementation
    20 implementation
    21 
    21 
    22 {$IFDEF HWLIBRARY}
    22 {$IFDEF HWLIBRARY}
    23 var xx, yy: LongInt;
       
    24 
    23 
    25 // retrieve protocol information
    24 // retrieve protocol information
    26 procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
    25 procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
    27 begin
    26 begin
    28 // http://bugs.freepascal.org/view.php?id=16156
    27 // http://bugs.freepascal.org/view.php?id=16156
   168 begin
   167 begin
   169     x^:= CursorPoint.X;
   168     x^:= CursorPoint.X;
   170     y^:= CursorPoint.Y;
   169     y^:= CursorPoint.Y;
   171 end;
   170 end;
   172 
   171 
   173 procedure HW_saveCursor(reset: boolean); cdecl; export;
   172 procedure HW_setPianoSound(snd: LongInt); cdecl; export;
   174 begin
   173 var CurSlot, CurAmmo: LongWord;
   175     if reset then
   174 begin
   176     begin
   175     CurSlot:= CurrentHedgehog^.CurSlot;
   177         CursorPoint.X:= xx;
   176     CurAmmo:= CurrentHedgehog^.CurAmmo;
   178         CursorPoint.Y:= yy;
   177     // this most likely won't work in network game
   179     end
   178     if (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amPiano) then
   180     else
   179         case snd of 
   181     begin
   180             0: PlaySound(sndPiano0);
   182         xx:= CursorPoint.X;
   181             1: PlaySound(sndPiano1);
   183         yy:= CursorPoint.Y;
   182             2: PlaySound(sndPiano2);
   184     end;
   183             3: PlaySound(sndPiano3);
       
   184             4: PlaySound(sndPiano4);
       
   185             5: PlaySound(sndPiano5);
       
   186             6: PlaySound(sndPiano6);
       
   187             7: PlaySound(sndPiano7);
       
   188             else PlaySound(sndPiano8);
       
   189         end;
   185 end;
   190 end;
   186 
   191 
   187 function HW_isAmmoOpen: boolean; cdecl; export;
   192 function HW_isAmmoOpen: boolean; cdecl; export;
   188 begin
   193 begin
   189     exit(bShowAmmoMenu);
   194     exit(bShowAmmoMenu);
   211         exit(CurAmmoGear^.AmmoType = amSwitch) 
   216         exit(CurAmmoGear^.AmmoType = amSwitch) 
   212     else
   217     else
   213         exit(false)
   218         exit(false)
   214 end;
   219 end;
   215 
   220 
       
   221 function HW_isPaused: boolean; cdecl; export;
       
   222 begin
       
   223     exit( isPaused );
       
   224 end;
       
   225 
   216 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   226 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   217 begin
   227 begin
   218     ParseCommand('/timer ' + inttostr(time), true);
   228     ParseCommand('/timer ' + inttostr(time), true);
   219 end;
   229 end;
   220 
   230