hedgewars/PascalExports.pas
branchexperimental3D
changeset 4812 f924be23ffb4
parent 4347 0ddb100fea61
parent 4603 d362ab6c7f53
child 4861 91f889289a47
equal deleted inserted replaced
4347:0ddb100fea61 4812:f924be23ffb4
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit PascalExports;
    21 unit PascalExports;
    22 
    22 
    23 interface
    23 interface
    24 uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, 
    24 uses uTypes, uConsts, uVariables, GLunit, uKeys, uChat, uSound, uAmmos, uUtils,
    25      uGears, uSound, hwengine, uAmmos, uLocale; // don't change the order!
    25      uCommands;
    26 
    26 
    27 {$INCLUDE "config.inc"}
    27 {$INCLUDE "config.inc"}
    28 
       
    29 var dummy: boolean;  // avoid compiler hint
       
    30 
    28 
    31 implementation
    29 implementation
    32 {$IFDEF HWLIBRARY}
    30 {$IFDEF HWLIBRARY}
    33 var cZoomVal: GLfloat;
    31 var cZoomVal: GLfloat;
       
    32     previousGameState: TGameState;
    34 
    33 
    35 // retrieve protocol information
    34 // retrieve protocol information
    36 procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
    35 procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
    37 begin
    36 begin
    38 // http://bugs.freepascal.org/view.php?id=16156
    37     netProto^:= cNetProtoVersion;
    39     if netProto <> nil then netProto^:= cNetProtoVersion;
    38     versionStr^:= cVersionString;
    40     if versionStr <> nil then versionStr^:= cVersionString;
       
    41 end;
    39 end;
    42 
    40 
    43 procedure HW_click; cdecl; export;
    41 procedure HW_click; cdecl; export;
    44 begin
    42 begin
    45     leftClick:= true;
    43     leftClick:= true;
   165     KeyPressChat(13); // enter - removes chat
   163     KeyPressChat(13); // enter - removes chat
   166 end;
   164 end;
   167 
   165 
   168 procedure HW_pause; cdecl; export;
   166 procedure HW_pause; cdecl; export;
   169 begin
   167 begin
       
   168     if isPaused = false then
       
   169         pauseAction:= true;
       
   170 end;
       
   171 
       
   172 procedure HW_pauseToggle; cdecl; export;
       
   173 begin
   170     pauseAction:= true;
   174     pauseAction:= true;
       
   175 end;
       
   176 
       
   177 function HW_isPaused: boolean; cdecl; export;
       
   178 begin
       
   179     exit( isPaused );
       
   180 end;
       
   181 
       
   182 procedure HW_suspend; cdecl; export;
       
   183 begin
       
   184     previousGameState:= GameState;
       
   185     GameState:= gsSuspend;
       
   186 end;
       
   187 
       
   188 procedure HW_resume; cdecl; export;
       
   189 begin
       
   190     GameState:= previousGameState;
   171 end;
   191 end;
   172 
   192 
   173 procedure HW_terminate(closeFrontend: boolean); cdecl; export;
   193 procedure HW_terminate(closeFrontend: boolean); cdecl; export;
   174 begin
   194 begin
   175     isTerminated:= true;
   195     isTerminated:= true;
   195 
   215 
   196 function HW_isAmmoMenuNotAllowed: boolean; cdecl; export;
   216 function HW_isAmmoMenuNotAllowed: boolean; cdecl; export;
   197 begin;
   217 begin;
   198     exit ( (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or
   218     exit ( (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or
   199            ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) );
   219            ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) );
   200 end;
       
   201 
       
   202 function HW_isPaused: boolean; cdecl; export;
       
   203 begin
       
   204     exit( isPaused );
       
   205 end;
   220 end;
   206 
   221 
   207 function HW_isWaiting: boolean; cdecl; export;
   222 function HW_isWaiting: boolean; cdecl; export;
   208 begin
   223 begin
   209     exit( ReadyTimeLeft > 0 );
   224     exit( ReadyTimeLeft > 0 );