hedgewars/PascalExports.pas
changeset 2690 8e83c7e31720
child 2691 c0da3a98c01c
equal deleted inserted replaced
2689:dfda97c153a4 2690:8e83c7e31720
       
     1 (*
       
     2  *  PascalExports.pas
       
     3  *  hwengine
       
     4  *
       
     5  *  Created by Vittorio on 09/01/10.
       
     6  *  Copyright 2009 __MyCompanyName__. All rights reserved.
       
     7  *
       
     8  *)
       
     9 
       
    10 
       
    11 {$INCLUDE "options.inc"}
       
    12 
       
    13 unit PascalExports;
       
    14 
       
    15 interface
       
    16 uses uKeys, uConsole;
       
    17 
       
    18 {$IFDEF IPHONEOS}
       
    19 // called by pascal code, they deal with the objc code
       
    20 function  IPH_getDocumentsPath: PChar; cdecl; external;
       
    21 procedure IPH_showControls; cdecl; external;
       
    22 
       
    23 // called by the touch functions (SDL_uikitview.m)
       
    24 // they emulate user interaction from mouse or keyboard
       
    25 procedure HW_click; cdecl; export;
       
    26 procedure HW_zoomIn; cdecl; export;
       
    27 procedure HW_zoomOut; cdecl; export;
       
    28 procedure HW_zoomReset; cdecl; export;
       
    29 procedure HW_ammoMenu; cdecl; export;
       
    30 procedure HW_allKeysUp; cdecl; export;
       
    31 procedure HW_walkLeft; cdecl; export;
       
    32 procedure HW_walkRight; cdecl; export;
       
    33 procedure HW_aimUp; cdecl; export;
       
    34 procedure HW_aimDown; cdecl; export;
       
    35 procedure HW_shoot; cdecl; export;
       
    36 procedure HW_whereIsHog; cdecl; export;
       
    37 
       
    38 {$ENDIF}
       
    39 
       
    40 implementation
       
    41 
       
    42 {$IFDEF IPHONEOS}
       
    43 procedure HW_click; cdecl; export;
       
    44 begin
       
    45 	WriteLnToConsole('HW - left click');
       
    46 	leftClick:= true;
       
    47 	exit
       
    48 end;
       
    49 
       
    50 procedure HW_zoomIn; cdecl; export;
       
    51 begin
       
    52 	WriteLnToConsole('HW - zooming in');
       
    53 	wheelUp:= true;
       
    54 	exit
       
    55 end;
       
    56 
       
    57 procedure HW_zoomOut; cdecl; export;
       
    58 begin
       
    59 	WriteLnToConsole('HW - zooming out');
       
    60 	wheelDown:= true;
       
    61 	exit
       
    62 end;
       
    63 
       
    64 procedure HW_zoomReset; cdecl; export;
       
    65 begin
       
    66 	WriteLnToConsole('HW - reset zoom');
       
    67 	middleClick:= true;
       
    68 	exit
       
    69 end;
       
    70 
       
    71 procedure HW_ammoMenu; cdecl; export;
       
    72 begin
       
    73 	WriteLnToConsole('HW - right click');
       
    74 	rightClick:= true;
       
    75 	exit
       
    76 end;
       
    77 
       
    78 procedure HW_allKeysUp; cdecl; export;
       
    79 begin
       
    80 	WriteLnToConsole('HW - resetting keyboard');
       
    81 
       
    82 	upKey:= false;
       
    83 	downKey:= false;
       
    84 	leftKey:= false;
       
    85 	rightKey:= false;
       
    86 	spaceKey:= false;
       
    87 	exit
       
    88 end;
       
    89 
       
    90 procedure HW_walkLeft; cdecl; export;
       
    91 begin
       
    92 	WriteLnToConsole('HW - walking left');
       
    93 	leftKey:= true;
       
    94 	exit
       
    95 end;
       
    96 
       
    97 procedure HW_walkRight; cdecl; export;
       
    98 begin
       
    99 	WriteLnToConsole('HW - walking right');
       
   100 	rightKey:= true;
       
   101 	exit
       
   102 end;
       
   103 
       
   104 procedure HW_aimUp; cdecl; export;
       
   105 begin
       
   106 	WriteLnToConsole('HW - aiming upwards');
       
   107 	upKey:= true;
       
   108 	exit
       
   109 end;
       
   110 
       
   111 procedure HW_aimDown; cdecl; export;
       
   112 begin
       
   113 	WriteLnToConsole('HW - aiming downwards');
       
   114 	downKey:= true;
       
   115 	exit
       
   116 end;
       
   117 
       
   118 procedure HW_shoot; cdecl; export;
       
   119 begin
       
   120 	WriteLnToConsole('HW - shooting');
       
   121 	spaceKey:= true;
       
   122 	exit
       
   123 end;
       
   124 
       
   125 procedure HW_whereIsHog; cdecl; export;
       
   126 var Xcoord, Ycoord: LongInt;
       
   127 begin
       
   128 	//Xcoord:= Gear^.dX + WorldDx;
       
   129 	WriteLnToConsole('HW - hog is at x: ' + ' y:');
       
   130 
       
   131 	exit
       
   132 end;
       
   133 {$ENDIF}
       
   134 
       
   135 end.
       
   136