author | koda |
Wed, 30 Jun 2010 23:27:18 +0200 | |
changeset 3599 | 715a43602da8 |
parent 3551 | d4de36b3801a |
child 3626 | 19f78afa0188 |
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 |
|
3551 | 16 |
uses uKeys, GLunit, uWorld, uMisc, uConsole, hwengine; |
2690 | 17 |
|
2924 | 18 |
{$INCLUDE "config.inc"} |
2691 | 19 |
|
2690 | 20 |
implementation |
21 |
||
2803
1f446fc5c8ec
allow to compile engine as library with HWLIBRARY symbol
koda
parents:
2799
diff
changeset
|
22 |
{$IFDEF HWLIBRARY} |
3063 | 23 |
// retrieve protocol information |
3245
252be02536ab
fix an error in passing strings between ObjC and Pascal
koda
parents:
3063
diff
changeset
|
24 |
procedure HW_versionInfo(netProto: PShortInt; versionStr: Ppchar); cdecl; export; |
2691 | 25 |
begin |
3245
252be02536ab
fix an error in passing strings between ObjC and Pascal
koda
parents:
3063
diff
changeset
|
26 |
// http://bugs.freepascal.org/view.php?id=16156 |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
27 |
if netProto <> nil then netProto^:= cNetProtoVersion; |
3245
252be02536ab
fix an error in passing strings between ObjC and Pascal
koda
parents:
3063
diff
changeset
|
28 |
if versionStr <> nil then versionStr^:= cVersionString; |
2691 | 29 |
end; |
30 |
||
2690 | 31 |
procedure HW_click; cdecl; export; |
32 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
33 |
leftClick:= true; |
2690 | 34 |
end; |
35 |
||
36 |
procedure HW_zoomIn; cdecl; export; |
|
37 |
begin |
|
3523 | 38 |
if wheelDown = false then |
39 |
wheelUp:= true; |
|
2690 | 40 |
end; |
41 |
||
42 |
procedure HW_zoomOut; cdecl; export; |
|
43 |
begin |
|
3523 | 44 |
if wheelUp = false then |
45 |
wheelDown:= true; |
|
2690 | 46 |
end; |
47 |
||
48 |
procedure HW_zoomReset; cdecl; export; |
|
49 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
50 |
middleClick:= true; |
2690 | 51 |
end; |
52 |
||
53 |
procedure HW_ammoMenu; cdecl; export; |
|
54 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
55 |
rightClick:= true; |
2690 | 56 |
end; |
57 |
||
58 |
procedure HW_allKeysUp; cdecl; export; |
|
59 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
60 |
// set all keys to released |
3040
3e7f4a30e18a
Insert commit message here (to get along with palewolf)
koda
parents:
3015
diff
changeset
|
61 |
uKeys.initModule; |
2690 | 62 |
end; |
63 |
||
64 |
procedure HW_walkLeft; cdecl; export; |
|
65 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
66 |
leftKey:= true; |
2690 | 67 |
end; |
68 |
||
69 |
procedure HW_walkRight; cdecl; export; |
|
70 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
71 |
rightKey:= true; |
2690 | 72 |
end; |
73 |
||
74 |
procedure HW_aimUp; cdecl; export; |
|
75 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
76 |
upKey:= true; |
2690 | 77 |
end; |
78 |
||
79 |
procedure HW_aimDown; cdecl; export; |
|
80 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
81 |
downKey:= true; |
2690 | 82 |
end; |
83 |
||
84 |
procedure HW_shoot; cdecl; export; |
|
85 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
86 |
spaceKey:= true; |
2690 | 87 |
end; |
88 |
||
3015 | 89 |
procedure HW_jump; cdecl; export; |
90 |
begin |
|
91 |
enterKey:= true; |
|
92 |
end; |
|
93 |
||
94 |
procedure HW_backjump; cdecl; export; |
|
95 |
begin |
|
96 |
backspaceKey:= true; |
|
97 |
end; |
|
98 |
||
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
99 |
procedure HW_chat; cdecl; export; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
100 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
101 |
chatAction:= true; |
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
102 |
end; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
103 |
|
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
104 |
procedure HW_tab; cdecl; export; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
105 |
begin |
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
106 |
switchAction:= true; |
2754
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
107 |
end; |
ad4f81fbfb76
touchinput works, invisible buttons added and initial support for chat
koda
parents:
2716
diff
changeset
|
108 |
|
2805 | 109 |
procedure HW_pause; cdecl; export; |
110 |
begin |
|
2948
3f21a9dc93d0
Replace tabs with spaces using 'expand -t 4' command
unc0rr
parents:
2924
diff
changeset
|
111 |
pauseAction:= true; |
2805 | 112 |
end; |
113 |
||
3347 | 114 |
procedure HW_cursorUp(coefficient:LongInt); cdecl; export; |
115 |
begin |
|
116 |
coeff:= coefficient; |
|
117 |
cursorUp:= true; |
|
118 |
end; |
|
119 |
||
120 |
procedure HW_cursorDown(coefficient:LongInt); cdecl; export; |
|
2690 | 121 |
begin |
3347 | 122 |
coeff:= coefficient; |
123 |
cursorDown:= true; |
|
124 |
end; |
|
2690 | 125 |
|
3347 | 126 |
procedure HW_cursorLeft(coefficient:LongInt); cdecl; export; |
127 |
begin |
|
128 |
coeff:= coefficient; |
|
129 |
cursorLeft:= true; |
|
130 |
end; |
|
131 |
||
132 |
procedure HW_cursorRight(coefficient:LongInt); cdecl; export; |
|
133 |
begin |
|
134 |
coeff:= coefficient; |
|
135 |
cursorRight:= true; |
|
2690 | 136 |
end; |
3063 | 137 |
|
138 |
procedure HW_terminate(closeFrontend: boolean); cdecl; export; |
|
139 |
begin |
|
140 |
isTerminated:= true; |
|
141 |
if closeFrontend then alsoShutdownFrontend:= true; |
|
142 |
end; |
|
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
143 |
|
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
144 |
procedure HW_setLandscape(landscape: boolean); cdecl; export; |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
145 |
begin |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
146 |
if landscape then |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
147 |
begin |
3463 | 148 |
cOffsetY:= 0; |
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
149 |
end |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
150 |
else |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
151 |
begin |
3463 | 152 |
cOffsetY:= 120; |
3395
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
153 |
end; |
095273ad0e08
adding a somewhat working autoration for ipad (uStore.pas and uWorld.pas got mixed in the last two commits)
koda
parents:
3347
diff
changeset
|
154 |
end; |
3551 | 155 |
|
156 |
procedure HW_setCursor(x,y: LongInt); cdecl; export; |
|
157 |
begin |
|
158 |
CursorPoint.X:= x; |
|
159 |
CursorPoint.Y:= y; |
|
160 |
end; |
|
161 |
||
162 |
function HW_isAmmoOpen:boolean; cdecl; export; |
|
163 |
begin |
|
164 |
exit(bShowAmmoMenu); |
|
165 |
end; |
|
2690 | 166 |
{$ENDIF} |
167 |
||
168 |
end. |
|
169 |