--- a/hedgewars/PascalExports.pas Thu Aug 12 23:15:11 2010 +0200
+++ b/hedgewars/PascalExports.pas Fri Aug 13 02:13:18 2010 +0200
@@ -18,8 +18,8 @@
{$INCLUDE "config.inc"}
implementation
-
{$IFDEF HWLIBRARY}
+var cZoomVal: GLfloat;
// retrieve protocol information
procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
@@ -34,6 +34,17 @@
leftClick:= true;
end;
+procedure HW_ammoMenu; cdecl; export;
+begin
+ rightClick:= true;
+end;
+
+procedure HW_zoomSet(value: GLfloat); cdecl; export;
+begin
+ cZoomVal:= value;
+ ZoomValue:= value;
+end;
+
procedure HW_zoomIn; cdecl; export;
begin
if wheelDown = false then
@@ -48,7 +59,8 @@
procedure HW_zoomReset; cdecl; export;
begin
- middleClick:= true;
+ ZoomValue:= cZoomVal;
+ //middleClick:= true;
// center the camera at current hog
if CurrentHedgehog <> nil then
followGear:= CurrentHedgehog^.Gear;
@@ -65,11 +77,6 @@
exit( trunc((ZoomValue - cDefaultZoomLevel) / cZoomDelta) );
end;
-procedure HW_ammoMenu; cdecl; export;
-begin
- rightClick:= true;
-end;
-
procedure HW_walkingKeysUp; cdecl; export;
begin
leftKey:= false;
@@ -183,31 +190,16 @@
y^:= CursorPoint.Y;
end;
-procedure HW_setPianoSound(snd: LongInt); cdecl; export;
-var CurSlot, CurAmmo: LongWord;
-begin
- 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;
begin
exit(bShowAmmoMenu);
end;
+function HW_isPaused: boolean; cdecl; export;
+begin
+ exit( isPaused );
+end;
+
function HW_isWeaponRequiringClick: boolean; cdecl; export;
begin
if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
@@ -232,9 +224,12 @@
exit(false)
end;
-function HW_isPaused: boolean; cdecl; export;
+function HW_isWeaponRope: boolean cdecl; export;
+var CurSlot, CurAmmo: LongWord;
begin
- exit( isPaused );
+ CurSlot:= CurrentHedgehog^.CurSlot;
+ CurAmmo:= CurrentHedgehog^.CurAmmo;
+ exit (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amRope)
end;
procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
@@ -242,6 +237,26 @@
ParseCommand('/timer ' + inttostr(time), true);
end;
+procedure HW_setPianoSound(snd: LongInt); cdecl; export;
+var CurSlot, CurAmmo: LongWord;
+begin
+ 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;
+
//amSwitch
{$ENDIF}