hedgewars/PascalExports.pas
changeset 6997 2356bf174df8
parent 6990 40e5af28d026
child 6998 f2524a80eea2
equal deleted inserted replaced
6996:a0052cd32508 6997:2356bf174df8
    50 begin
    50 begin
    51     netProto^:= cNetProtoVersion;
    51     netProto^:= cNetProtoVersion;
    52     versionStr^:= cVersionString;
    52     versionStr^:= cVersionString;
    53 end;
    53 end;
    54 
    54 
    55 // emulate mouse/keyboard input
       
    56 procedure HW_click; cdecl; export;
       
    57 begin
       
    58     leftClick:= true;
       
    59 end;
       
    60 
       
    61 procedure HW_ammoMenu; cdecl; export;
       
    62 begin
       
    63     rightClick:= true;
       
    64 end;
       
    65 
       
    66 procedure HW_zoomSet(value: GLfloat); cdecl; export;
    55 procedure HW_zoomSet(value: GLfloat); cdecl; export;
    67 begin
    56 begin
    68     cZoomVal:= value;
    57     cZoomVal:= value;
    69     ZoomValue:= value;
    58     ZoomValue:= value;
    70 end;
       
    71 
       
    72 procedure HW_zoomIn; cdecl; export;
       
    73 begin
       
    74     if wheelDown = false then
       
    75         wheelUp:= true;
       
    76 end;
       
    77 
       
    78 procedure HW_zoomOut; cdecl; export;
       
    79 begin
       
    80     if wheelUp = false then
       
    81         wheelDown:= true;
       
    82 end;
    59 end;
    83 
    60 
    84 procedure HW_zoomReset; cdecl; export;
    61 procedure HW_zoomReset; cdecl; export;
    85 begin
    62 begin
    86     ZoomValue:= cZoomVal;
    63     ZoomValue:= cZoomVal;
    97 function HW_zoomLevel: LongInt; cdecl; export;
    74 function HW_zoomLevel: LongInt; cdecl; export;
    98 begin
    75 begin
    99     HW_zoomLevel:= trunc((ZoomValue - cDefaultZoomLevel) / cZoomDelta);
    76     HW_zoomLevel:= trunc((ZoomValue - cDefaultZoomLevel) / cZoomDelta);
   100 end;
    77 end;
   101 
    78 
   102 procedure HW_walkingKeysUp; cdecl; export;
       
   103 begin
       
   104     leftKey:= false;
       
   105     rightKey:= false;
       
   106     upKey:= false;
       
   107     downKey:= false;
       
   108     preciseKey:= false;
       
   109 end;
       
   110 
       
   111 procedure HW_otherKeysUp; cdecl; export;
       
   112 begin
       
   113     spaceKey:= false;
       
   114     enterKey:= false;
       
   115     backspaceKey:= false;
       
   116 end;
       
   117 
       
   118 procedure HW_allKeysUp; cdecl; export;
       
   119 begin
       
   120     // set all keys to released
       
   121     uInputHandler.initModule;
       
   122 end;
       
   123 
       
   124 procedure HW_walkLeft; cdecl; export;
       
   125 begin
       
   126     leftKey:= true;
       
   127 end;
       
   128 
       
   129 procedure HW_walkRight; cdecl; export;
       
   130 begin
       
   131     rightKey:= true;
       
   132 end;
       
   133 
       
   134 procedure HW_preciseSet(status:boolean); cdecl; export;
       
   135 begin
       
   136     preciseKey:= status;
       
   137 end;
       
   138 
       
   139 procedure HW_aimUp; cdecl; export;
       
   140 begin
       
   141     upKey:= true;
       
   142 end;
       
   143 
       
   144 procedure HW_aimDown; cdecl; export;
       
   145 begin
       
   146     downKey:= true;
       
   147 end;
       
   148 
       
   149 procedure HW_shoot; cdecl; export;
       
   150 begin
       
   151     spaceKey:= true;
       
   152 end;
       
   153 
       
   154 procedure HW_jump; cdecl; export;
       
   155 begin
       
   156     enterKey:= true;
       
   157 end;
       
   158 
       
   159 procedure HW_backjump; cdecl; export;
       
   160 begin
       
   161     backspaceKey:= true;
       
   162 end;
       
   163 
       
   164 procedure HW_tab; cdecl; export;
       
   165 begin
       
   166     tabKey:= true;
       
   167 end;
       
   168 
       
   169 procedure HW_chat; cdecl; export;
       
   170 begin
       
   171     chatAction:= true;
       
   172 end;
       
   173 
       
   174 procedure HW_screenshot; cdecl; export;
    79 procedure HW_screenshot; cdecl; export;
   175 begin
    80 begin
   176     flagMakeCapture:= true;
    81     flagMakeCapture:= true;
   177 end;
       
   178 
       
   179 procedure HW_pause; cdecl; export;
       
   180 begin
       
   181     if isPaused = false then
       
   182         pauseAction:= true;
       
   183 end;
       
   184 
       
   185 procedure HW_pauseToggle; cdecl; export;
       
   186 begin
       
   187     pauseAction:= true;
       
   188 end;
    82 end;
   189 
    83 
   190 function HW_isPaused: boolean; cdecl; export;
    84 function HW_isPaused: boolean; cdecl; export;
   191 begin
    85 begin
   192     HW_isPaused:= isPaused;
    86     HW_isPaused:= isPaused;
   199     ParseCommand('forcequit', true);
    93     ParseCommand('forcequit', true);
   200 end;
    94 end;
   201 
    95 
   202 function HW_getSDLWindow: pointer; cdecl; export;
    96 function HW_getSDLWindow: pointer; cdecl; export;
   203 begin
    97 begin
   204     HW_getSDLWindow:= nil;
    98     HW_getSDLWindow:={$IFDEF SDL13}SDLwindow{$ELSE}nil{$ENDIF};
   205 {$IFDEF SDL13}
       
   206     HW_getSDLWindow:= SDLwindow;
       
   207 {$ENDIF}
       
   208 end;
    99 end;
   209 
   100 
   210 // cursor handling
   101 // cursor handling
   211 procedure HW_setCursor(x,y: LongInt); cdecl; export;
   102 procedure HW_setCursor(x,y: LongInt); cdecl; export;
   212 begin
   103 begin