author | nemo |
Mon, 22 Feb 2010 05:41:25 +0000 | |
changeset 2842 | 03d6a304a8e0 |
parent 2805 | 36a8cebb91e8 |
child 2905 | f3c79f7193a9 |
permissions | -rw-r--r-- |
2690 | 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 |
||
2691 | 18 |
{$INCLUDE "proto.inc"} |
19 |
||
2690 | 20 |
{$IFDEF IPHONEOS} |
21 |
// called by pascal code, they deal with the objc code |
|
22 |
function IPH_getDocumentsPath: PChar; cdecl; external; |
|
23 |
procedure IPH_showControls; cdecl; external; |
|
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2799
diff
changeset
|
24 |
{$ENDIF} |
2690 | 25 |
|
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2799
diff
changeset
|
26 |
{$IFDEF HWLIBRARY} |
2691 | 27 |
// retrieve protocol information |
2799 | 28 |
procedure HW_versionInfo(netProto: PShortInt; versionStr: PString); cdecl; export; |
2691 | 29 |
|
2690 | 30 |
// called by the touch functions (SDL_uikitview.m) |
31 |
// they emulate user interaction from mouse or keyboard |
|
32 |
procedure HW_click; cdecl; export; |
|
33 |
procedure HW_zoomIn; cdecl; export; |
|
34 |
procedure HW_zoomOut; cdecl; export; |
|
35 |
procedure HW_zoomReset; cdecl; export; |
|
36 |
procedure HW_ammoMenu; cdecl; export; |
|
37 |
procedure HW_allKeysUp; cdecl; export; |
|
38 |
procedure HW_walkLeft; cdecl; export; |
|
39 |
procedure HW_walkRight; cdecl; export; |
|
40 |
procedure HW_aimUp; cdecl; export; |
|
41 |
procedure HW_aimDown; cdecl; export; |
|
42 |
procedure HW_shoot; cdecl; export; |
|
43 |
procedure HW_whereIsHog; cdecl; export; |
|
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
44 |
procedure HW_chat; cdecl; export; |
2805 | 45 |
procedure HW_pause; cdecl; export; |
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
46 |
procedure HW_tab; cdecl; export; |
2690 | 47 |
{$ENDIF} |
48 |
||
49 |
implementation |
|
50 |
||
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2799
diff
changeset
|
51 |
{$IFDEF HWLIBRARY} |
2799 | 52 |
procedure HW_versionInfo(netProto: PShortInt; versionStr: PString); cdecl; export; |
2691 | 53 |
begin |
2799 | 54 |
if netProto <> nil then netProto^:= cNetProtoVersion; |
55 |
if versionStr <> nil then versionStr^:= string(cVersionString); |
|
2691 | 56 |
end; |
57 |
||
2690 | 58 |
procedure HW_click; cdecl; export; |
59 |
begin |
|
60 |
leftClick:= true; |
|
61 |
end; |
|
62 |
||
63 |
procedure HW_zoomIn; cdecl; export; |
|
64 |
begin |
|
65 |
wheelUp:= true; |
|
66 |
end; |
|
67 |
||
68 |
procedure HW_zoomOut; cdecl; export; |
|
69 |
begin |
|
70 |
wheelDown:= true; |
|
71 |
end; |
|
72 |
||
73 |
procedure HW_zoomReset; cdecl; export; |
|
74 |
begin |
|
75 |
middleClick:= true; |
|
76 |
end; |
|
77 |
||
78 |
procedure HW_ammoMenu; cdecl; export; |
|
79 |
begin |
|
80 |
rightClick:= true; |
|
81 |
end; |
|
82 |
||
83 |
procedure HW_allKeysUp; cdecl; export; |
|
84 |
begin |
|
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
85 |
// set all keys to released |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
86 |
init_uKeys(); |
2690 | 87 |
end; |
88 |
||
89 |
procedure HW_walkLeft; cdecl; export; |
|
90 |
begin |
|
91 |
leftKey:= true; |
|
92 |
end; |
|
93 |
||
94 |
procedure HW_walkRight; cdecl; export; |
|
95 |
begin |
|
96 |
rightKey:= true; |
|
97 |
end; |
|
98 |
||
99 |
procedure HW_aimUp; cdecl; export; |
|
100 |
begin |
|
101 |
upKey:= true; |
|
102 |
end; |
|
103 |
||
104 |
procedure HW_aimDown; cdecl; export; |
|
105 |
begin |
|
106 |
downKey:= true; |
|
107 |
end; |
|
108 |
||
109 |
procedure HW_shoot; cdecl; export; |
|
110 |
begin |
|
111 |
spaceKey:= true; |
|
112 |
end; |
|
113 |
||
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
114 |
procedure HW_chat; cdecl; export; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
115 |
begin |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
116 |
chatAction:= true; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
117 |
end; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
118 |
|
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
119 |
procedure HW_tab; cdecl; export; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
120 |
begin |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
121 |
switchAction:= true; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
122 |
end; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
123 |
|
2805 | 124 |
procedure HW_pause; cdecl; export; |
125 |
begin |
|
126 |
pauseAction:= true; |
|
127 |
end; |
|
128 |
||
2690 | 129 |
procedure HW_whereIsHog; cdecl; export; |
2698 | 130 |
//var Xcoord, Ycoord: LongInt; |
2690 | 131 |
begin |
132 |
//Xcoord:= Gear^.dX + WorldDx; |
|
133 |
WriteLnToConsole('HW - hog is at x: ' + ' y:'); |
|
134 |
||
135 |
exit |
|
136 |
end; |
|
137 |
{$ENDIF} |
|
138 |
||
139 |
end. |
|
140 |