hedgewars/PascalExports.pas
branchexperimental3D
changeset 4812 f924be23ffb4
parent 4347 0ddb100fea61
parent 4603 d362ab6c7f53
child 4861 91f889289a47
--- a/hedgewars/PascalExports.pas	Mon Dec 27 23:57:44 2010 +0100
+++ b/hedgewars/PascalExports.pas	Tue Jan 04 12:53:46 2011 +0100
@@ -21,23 +21,21 @@
 unit PascalExports;
 
 interface
-uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, 
-     uGears, uSound, hwengine, uAmmos, uLocale; // don't change the order!
+uses uTypes, uConsts, uVariables, GLunit, uKeys, uChat, uSound, uAmmos, uUtils,
+     uCommands;
 
 {$INCLUDE "config.inc"}
 
-var dummy: boolean;  // avoid compiler hint
-
 implementation
 {$IFDEF HWLIBRARY}
 var cZoomVal: GLfloat;
+    previousGameState: TGameState;
 
 // retrieve protocol information
-procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
+procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
 begin
-// http://bugs.freepascal.org/view.php?id=16156
-    if netProto <> nil then netProto^:= cNetProtoVersion;
-    if versionStr <> nil then versionStr^:= cVersionString;
+    netProto^:= cNetProtoVersion;
+    versionStr^:= cVersionString;
 end;
 
 procedure HW_click; cdecl; export;
@@ -167,9 +165,31 @@
 
 procedure HW_pause; cdecl; export;
 begin
+    if isPaused = false then
+        pauseAction:= true;
+end;
+
+procedure HW_pauseToggle; cdecl; export;
+begin
     pauseAction:= true;
 end;
 
+function HW_isPaused: boolean; cdecl; export;
+begin
+    exit( isPaused );
+end;
+
+procedure HW_suspend; cdecl; export;
+begin
+    previousGameState:= GameState;
+    GameState:= gsSuspend;
+end;
+
+procedure HW_resume; cdecl; export;
+begin
+    GameState:= previousGameState;
+end;
+
 procedure HW_terminate(closeFrontend: boolean); cdecl; export;
 begin
     isTerminated:= true;
@@ -199,11 +219,6 @@
            ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) );
 end;
 
-function HW_isPaused: boolean; cdecl; export;
-begin
-    exit( isPaused );
-end;
-
 function HW_isWaiting: boolean; cdecl; export;
 begin
     exit( ReadyTimeLeft > 0 );