author | koda |
Tue, 26 Jan 2010 21:55:51 +0000 | |
changeset 2716 | b9ca1bfca24f |
parent 2715 | 0e4e0db79e2a |
child 2717 | 2b75ef82676d |
permissions | -rw-r--r-- |
498 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
393 | 3 |
* Copyright (c) 2004-2007 Andrey Korotaev <unC0Rr@gmail.com> |
51 | 4 |
* |
183 | 5 |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
51 | 8 |
* |
183 | 9 |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
51 | 13 |
* |
183 | 14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
51 | 17 |
*) |
18 |
||
2599 | 19 |
{$INCLUDE "options.inc"} |
2587
0dfa56a8513c
fix a segfault in the iphone simulator by moving options.inc at the beginning of the file
koda
parents:
2586
diff
changeset
|
20 |
|
2698 | 21 |
{$IFDEF IPHONEOS} |
22 |
unit hwengine; |
|
23 |
interface |
|
24 |
{$ELSE} |
|
51 | 25 |
program hwengine; |
2698 | 26 |
{$ENDIF} |
2690 | 27 |
uses SDLh in 'SDLh.pas', |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
28 |
uConsts in 'uConsts.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
29 |
uGame in 'uGame.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
30 |
uMisc in 'uMisc.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
31 |
uStore in 'uStore.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
32 |
uWorld in 'uWorld.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
33 |
uIO in 'uIO.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
34 |
uGears in 'uGears.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
35 |
uVisualGears in 'uVisualGears.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
36 |
uConsole in 'uConsole.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
37 |
uKeys in 'uKeys.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
38 |
uTeams in 'uTeams.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
39 |
uSound in 'uSound.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
40 |
uRandom in 'uRandom.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
41 |
uAI in 'uAI.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
42 |
uAIMisc in 'uAIMisc.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
43 |
uAIAmmoTests in 'uAIAmmoTests.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
44 |
uAIActions in 'uAIActions.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
45 |
uCollisions in 'uCollisions.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
46 |
uLand in 'uLand.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
47 |
uLandTemplates in 'uLandTemplates.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
48 |
uLandObjects in 'uLandObjects.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
49 |
uLandGraphics in 'uLandGraphics.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
50 |
uLocale in 'uLocale.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
51 |
uAmmos in 'uAmmos.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
52 |
uSHA in 'uSHA.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
53 |
uFloat in 'uFloat.pas', |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
54 |
uStats in 'uStats.pas', |
1807 | 55 |
uChat in 'uChat.pas', |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
56 |
uTriggers in 'uTriggers.pas', |
2690 | 57 |
uLandTexture in 'uLandTexture.pas' |
58 |
{$IFDEF IPHONEOS} |
|
59 |
, PascalExports in 'PascalExports.pas' |
|
60 |
{$ENDIF} |
|
61 |
; |
|
51 | 62 |
|
63 |
// also: GSHandlers.inc |
|
64 |
// CCHandlers.inc |
|
65 |
// HHHandlers.inc |
|
357 | 66 |
// SinTable.inc |
271 | 67 |
// proto.inc |
51 | 68 |
|
2698 | 69 |
{$IFDEF IPHONEOS} |
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
70 |
type arrayofpchar = array[0..6] of PChar; |
2698 | 71 |
procedure DoTimer(Lag: LongInt); |
72 |
procedure OnDestroy; |
|
73 |
procedure MainLoop; |
|
74 |
procedure ShowMainWindow; |
|
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
75 |
procedure Game(gameArgs: arrayofpchar); cdecl; export; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
76 |
procedure initEverything; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
77 |
procedure freeEverything; |
51 | 78 |
|
2698 | 79 |
implementation |
80 |
||
81 |
{$ELSE} |
|
51 | 82 |
procedure OnDestroy; forward; |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
83 |
procedure freeEverything; forward; |
2698 | 84 |
{$ENDIF} |
51 | 85 |
|
86 |
//////////////////////////////// |
|
371 | 87 |
procedure DoTimer(Lag: LongInt); |
2243
b4764993f833
additional touch support and nemo's reduced land array size
koda
parents:
2191
diff
changeset
|
88 |
{$IFNDEF IPHONEOS} |
1080 | 89 |
var s: string; |
2243
b4764993f833
additional touch support and nemo's reduced land array size
koda
parents:
2191
diff
changeset
|
90 |
{$ENDIF} |
51 | 91 |
begin |
2698 | 92 |
inc(RealTicks, Lag); |
564 | 93 |
|
2698 | 94 |
case GameState of |
95 |
gsLandGen: begin |
|
96 |
GenMap; |
|
97 |
GameState:= gsStart; |
|
98 |
end; |
|
99 |
gsStart: begin |
|
100 |
if HasBorder then DisableSomeWeapons; |
|
101 |
AddClouds; |
|
102 |
AssignHHCoords; |
|
103 |
AddMiscGears; |
|
104 |
StoreLoad; |
|
105 |
InitWorld; |
|
106 |
ResetKbd; |
|
107 |
SoundLoad; |
|
108 |
if GameType = gmtSave then |
|
109 |
begin |
|
110 |
isSEBackup:= isSoundEnabled; |
|
111 |
isSoundEnabled:= false |
|
112 |
end; |
|
113 |
FinishProgress; |
|
114 |
PlayMusic; |
|
115 |
SetScale(zoom); |
|
116 |
GameState:= gsGame; |
|
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
117 |
end; |
2698 | 118 |
gsConfirm, |
119 |
gsGame: begin |
|
120 |
DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible |
|
121 |
ProcessKbd; |
|
122 |
DoGameTick(Lag); |
|
123 |
ProcessVisualGears(Lag); |
|
124 |
end; |
|
125 |
gsChat: begin |
|
126 |
DrawWorld(Lag); |
|
127 |
DoGameTick(Lag); |
|
128 |
ProcessVisualGears(Lag); |
|
129 |
end; |
|
130 |
gsExit: begin |
|
131 |
isTerminated:= true; |
|
132 |
end; |
|
133 |
end; |
|
564 | 134 |
|
2698 | 135 |
SDL_GL_SwapBuffers(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
136 |
{$IFDEF SDL13} |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
137 |
SDL_RenderPresent(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
138 |
{$ENDIF} |
2171
8208946331ba
Smaxx refactor of LoadImage to use flags, iphone changes by koda (mostly use of rgba instead of rgb)
nemo
parents:
2162
diff
changeset
|
139 |
{$IFNDEF IPHONEOS} |
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
140 |
// not going to make captures on the iPhone |
2698 | 141 |
if flagMakeCapture then |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
142 |
begin |
2698 | 143 |
flagMakeCapture:= false; |
144 |
s:= 'hw_' + cSeed + '_' + inttostr(GameTicks) + '.tga'; |
|
145 |
WriteLnToConsole('Saving ' + s); |
|
146 |
MakeScreenshot(s); |
|
147 |
//SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1) |
|
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
148 |
end; |
2171
8208946331ba
Smaxx refactor of LoadImage to use flags, iphone changes by koda (mostly use of rgba instead of rgb)
nemo
parents:
2162
diff
changeset
|
149 |
{$ENDIF} |
51 | 150 |
end; |
151 |
||
152 |
//////////////////// |
|
79 | 153 |
procedure OnDestroy; |
51 | 154 |
begin |
2692
ce9992075118
better network support + initial work for returning to frontend
koda
parents:
2691
diff
changeset
|
155 |
WriteLnToConsole('Freeing resources...'); |
2688 | 156 |
if isSoundEnabled then ReleaseSound(); |
157 |
StoreRelease(); |
|
158 |
FreeLand(); |
|
2692
ce9992075118
better network support + initial work for returning to frontend
koda
parents:
2691
diff
changeset
|
159 |
ControllerClose(); |
2688 | 160 |
SendKB(); |
161 |
CloseIPC(); |
|
162 |
TTF_Quit(); |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
163 |
{$IFDEF SDL13}SDL_VideoQuit();{$ENDIF} |
2688 | 164 |
SDL_Quit(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
165 |
freeEverything(); |
2698 | 166 |
exit(); |
51 | 167 |
end; |
168 |
||
169 |
/////////////////// |
|
2698 | 170 |
procedure MainLoop; |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
171 |
var PrevTime, CurrTime: Longword; |
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
172 |
{$IFNDEF IPHONEOS}event: TSDL_Event;{$ENDIF} |
2698 | 173 |
begin |
174 |
PrevTime:= SDL_GetTicks; |
|
175 |
repeat |
|
176 |
{$IFNDEF IPHONEOS} |
|
177 |
// have to remove this cycle because otherwise it segfaults at exit |
|
178 |
while SDL_PollEvent(@event) <> 0 do |
|
179 |
begin |
|
180 |
case event.type_ of |
|
181 |
SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode); |
|
182 |
{$IFDEF SDL13} |
|
183 |
SDL_WINDOWEVENT: |
|
184 |
{$ELSE} |
|
185 |
SDL_ACTIVEEVENT: |
|
2569 | 186 |
{$ENDIF} |
2698 | 187 |
if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
188 |
cHasFocus:= event.active.gain = 1; |
|
189 |
//SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450)); |
|
190 |
SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then uKeys.wheelDown:= true; |
|
191 |
SDL_MOUSEBUTTONUP: if event.button.button = SDL_BUTTON_WHEELUP then uKeys.wheelUp:= true; |
|
192 |
SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
|
193 |
SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
|
194 |
SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
|
195 |
SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
|
196 |
SDL_QUITEV: isTerminated:= true |
|
197 |
end; // end case event.type_ of |
|
198 |
end; // end while SDL_PollEvent(@event) <> 0 do |
|
2390 | 199 |
{$ENDIF} |
2698 | 200 |
CurrTime:= SDL_GetTicks; |
201 |
if PrevTime + cTimerInterval <= CurrTime then |
|
202 |
begin |
|
203 |
DoTimer(CurrTime - PrevTime); |
|
204 |
PrevTime:= CurrTime |
|
205 |
end else SDL_Delay(1); |
|
206 |
if isTerminated = false then IPCCheckSock(); |
|
207 |
until isTerminated; |
|
208 |
||
209 |
exit(); |
|
210 |
end; |
|
211 |
||
212 |
///////////////////////// |
|
213 |
procedure ShowMainWindow; |
|
214 |
begin |
|
215 |
if cFullScreen then ParseCommand('fullscr 1', true) |
|
216 |
else ParseCommand('fullscr 0', true); |
|
217 |
SDL_ShowCursor(0) |
|
218 |
end; |
|
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
219 |
|
2698 | 220 |
/////////////// |
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
221 |
{$IFDEF IPHONEOS} |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
222 |
procedure Game(gameArgs: arrayofpchar); cdecl; export; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
223 |
{$ELSE} |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
224 |
procedure Game;cdecl; export; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
225 |
{$ENDIF} |
2698 | 226 |
var p: TPathType; |
227 |
s: shortstring; |
|
228 |
begin |
|
229 |
{$IFDEF IPHONEOS} |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
230 |
initEverything(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
231 |
Randomize(); |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
232 |
|
2698 | 233 |
val('320', cScreenWidth); |
234 |
val('480', cScreenHeight); |
|
235 |
cInitWidth:= cScreenWidth; |
|
236 |
cInitHeight:= cScreenHeight; |
|
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
237 |
cBitsStr:= '32'; |
2698 | 238 |
val(cBitsStr, cBits); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
239 |
cFullScreen:= false; |
2698 | 240 |
cVSyncInUse:= true; |
241 |
val('8', cTimerInterval); |
|
242 |
PathPrefix:= 'Data'; |
|
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
243 |
cReducedQuality:= false; |
2698 | 244 |
cShowFPS:= true; |
2702
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
245 |
|
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
246 |
UserNick:= gameArgs[0]; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
247 |
val(gameArgs[1], ipcPort); |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
248 |
isSoundEnabled:= gameArgs[2] = '1'; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
249 |
isMusicEnabled:= gameArgs[3] = '1'; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
250 |
cLocaleFName:= gameArgs[4]; |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
251 |
val(gameArgs[5], cInitVolume); |
48fc46a922fd
rewrite gamesetup to use less memory, rename effects to sound plus some nice actions, settings work in game again
koda
parents:
2699
diff
changeset
|
252 |
cAltDamage:= gameArgs[6] = '1'; |
2600 | 253 |
{$ENDIF} |
2698 | 254 |
|
255 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
|
256 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p]; |
|
257 |
||
258 |
WriteToConsole('Init SDL... '); |
|
2714
c85ffe57d971
update iphone frontend to the new (silly) sdl api, code cleanups for other sections
koda
parents:
2705
diff
changeset
|
259 |
SDLTry(SDL_Init(SDL_INIT_VIDEO) >= 0, true); |
2698 | 260 |
WriteLnToConsole(msgOK); |
261 |
||
262 |
SDL_EnableUNICODE(1); |
|
263 |
||
264 |
WriteToConsole('Init SDL_ttf... '); |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
265 |
SDLTry(TTF_Init() <> -1, true); |
2698 | 266 |
WriteLnToConsole(msgOK); |
267 |
||
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
268 |
ShowMainWindow(); |
2698 | 269 |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
270 |
AddProgress(); |
2698 | 271 |
|
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
272 |
ControllerInit(); // has to happen before InitKbdKeyTable to map keys |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
273 |
InitKbdKeyTable(); |
2698 | 274 |
|
275 |
if recordFileName = '' then |
|
276 |
InitIPC; |
|
277 |
WriteLnToConsole(msgGettingConfig); |
|
278 |
||
279 |
if cLocaleFName <> 'en.txt' then |
|
280 |
LoadLocale(Pathz[ptLocale] + '/en.txt'); |
|
281 |
LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
|
282 |
||
283 |
if recordFileName = '' then |
|
284 |
SendIPCAndWaitReply('C') // ask for game config |
|
285 |
else |
|
286 |
LoadRecordFromFile(recordFileName); |
|
287 |
||
288 |
s:= 'eproto ' + inttostr(cNetProtoVersion); |
|
289 |
SendIPCRaw(@s[0], Length(s) + 1); // send proto version |
|
290 |
||
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
291 |
InitTeams(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
292 |
AssignStores(); |
2590 | 293 |
|
2698 | 294 |
if isSoundEnabled then |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
295 |
InitSound(); |
2698 | 296 |
|
297 |
isDeveloperMode:= false; |
|
298 |
||
299 |
TryDo(InitStepsFlags = cifAllInited, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
|
300 |
||
301 |
MainLoop(); |
|
302 |
OnDestroy(); |
|
303 |
exit(); |
|
304 |
end; |
|
2590 | 305 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
306 |
procedure initEverything; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
307 |
begin |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
308 |
init_uConsts(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
309 |
init_uMisc(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
310 |
init_uConsole(); // MUST happen after uMisc |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
311 |
|
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
312 |
init_uAI(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
313 |
//uAIActions does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
314 |
//uAIAmmoTests does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
315 |
init_uAIMisc(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
316 |
init_uAmmos(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
317 |
init_uChat(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
318 |
init_uCollisions(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
319 |
//uFloat does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
320 |
//uGame does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
321 |
init_uGears(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
322 |
init_uIO(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
323 |
init_uKeys(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
324 |
init_uLand(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
325 |
//uLandGraphics does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
326 |
//uLandObjects does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
327 |
//uLandTemplates does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
328 |
//uLandTexture does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
329 |
//uLocale does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
330 |
init_uRandom(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
331 |
//uSHA does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
332 |
init_uSound(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
333 |
init_uStats(); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
334 |
init_uStore(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
335 |
init_uTeams(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
336 |
init_uTriggers(); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
337 |
init_uVisualGears(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
338 |
init_uWorld(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
339 |
end; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
340 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
341 |
procedure freeEverything; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
342 |
begin |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
343 |
free_uWorld(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
344 |
free_uVisualGears(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
345 |
free_uTriggers(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
346 |
free_uTeams(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
347 |
free_uStore(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
348 |
free_uStats(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
349 |
free_uSound(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
350 |
//uSHA does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
351 |
free_uRandom(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
352 |
//uLocale does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
353 |
//uLandTemplates does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
354 |
//uLandTexture does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
355 |
//uLandObjects does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
356 |
//uLandGraphics does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
357 |
free_uLand(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
358 |
free_uKeys(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
359 |
free_uIO(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
360 |
free_uGears(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
361 |
//uGame does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
362 |
//uFloat does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
363 |
free_uCollisions(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
364 |
free_uChat(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
365 |
free_uAmmos(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
366 |
free_uAIMisc(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
367 |
//uAIAmmoTests does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
368 |
//uAIActions does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
369 |
free_uAI(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
370 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
371 |
free_uConsole(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
372 |
free_uMisc(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
373 |
free_uConsts(); //stub |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
374 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
375 |
end; |
2698 | 376 |
{$IFNDEF IPHONEOS} |
377 |
///////////////////////// |
|
378 |
procedure GenLandPreview; |
|
379 |
var Preview: TPreview; |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
380 |
h: byte; |
2698 | 381 |
begin |
382 |
InitIPC; |
|
383 |
IPCWaitPongEvent; |
|
384 |
TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
|
385 |
||
386 |
Preview:= GenPreview; |
|
387 |
WriteLnToConsole('Sending preview...'); |
|
388 |
SendIPCRaw(@Preview, sizeof(Preview)); |
|
389 |
h:= MaxHedgehogs; |
|
390 |
SendIPCRaw(@h, sizeof(h)); |
|
391 |
WriteLnToConsole('Preview sent, disconnect'); |
|
392 |
CloseIPC(); |
|
393 |
end; |
|
394 |
||
395 |
//////////////////////////////// |
|
396 |
procedure Resize(w, h: LongInt); |
|
397 |
begin |
|
398 |
cScreenWidth:= w; |
|
399 |
cScreenHeight:= h; |
|
400 |
if cFullScreen then |
|
401 |
ParseCommand('/fullscr 1', true) |
|
402 |
else |
|
403 |
ParseCommand('/fullscr 0', true); |
|
51 | 404 |
end; |
405 |
||
2008 | 406 |
///////////////////// |
407 |
procedure DisplayUsage; |
|
2691 | 408 |
var i: LongInt; |
2008 | 409 |
begin |
410 |
WriteLn('Wrong argument format: correct configurations is'); |
|
411 |
WriteLn(); |
|
412 |
WriteLn(' hwengine <path to data folder> <path to replay file> [option]'); |
|
413 |
WriteLn(); |
|
414 |
WriteLn('where [option] must be specified either as'); |
|
2264 | 415 |
WriteLn(' --set-video [screen width] [screen height] [color dept]'); |
2008 | 416 |
WriteLn(' --set-audio [volume] [enable music] [enable sounds]'); |
417 |
WriteLn(' --set-other [language file] [full screen] [show FPS]'); |
|
418 |
WriteLn(' --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]'); |
|
419 |
WriteLn(' --set-everything [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]'); |
|
420 |
WriteLn(); |
|
2015 | 421 |
WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information'); |
2691 | 422 |
Write('parsed command: '); |
2698 | 423 |
for i:=0 to ParamCount do |
424 |
Write(ParamStr(i) + ' '); |
|
2691 | 425 |
WriteLn(); |
2015 | 426 |
halt(1); |
2008 | 427 |
end; |
428 |
||
51 | 429 |
//////////////////// |
430 |
procedure GetParams; |
|
267 | 431 |
{$IFDEF DEBUGFILE} |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
432 |
var i: LongInt; |
267 | 433 |
{$ENDIF} |
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
434 |
begin |
267 | 435 |
|
2698 | 436 |
case ParamCount of |
437 |
17: begin |
|
438 |
val(ParamStr(2), cScreenWidth); |
|
439 |
val(ParamStr(3), cScreenHeight); |
|
2008 | 440 |
cInitWidth:= cScreenWidth; |
441 |
cInitHeight:= cScreenHeight; |
|
2698 | 442 |
cBitsStr:= ParamStr(4); |
2008 | 443 |
val(cBitsStr, cBits); |
2698 | 444 |
val(ParamStr(5), ipcPort); |
445 |
cFullScreen:= ParamStr(6) = '1'; |
|
446 |
isSoundEnabled:= ParamStr(7) = '1'; |
|
447 |
cVSyncInUse:= ParamStr(8) = '1'; |
|
448 |
cLocaleFName:= ParamStr(9); |
|
449 |
val(ParamStr(10), cInitVolume); |
|
450 |
val(ParamStr(11), cTimerInterval); |
|
451 |
PathPrefix:= ParamStr(12); |
|
452 |
cShowFPS:= ParamStr(13) = '1'; |
|
453 |
cAltDamage:= ParamStr(14) = '1'; |
|
454 |
UserNick:= DecodeBase64(ParamStr(15)); |
|
455 |
isMusicEnabled:= ParamStr(16) = '1'; |
|
456 |
cReducedQuality:= ParamStr(17) = '1'; |
|
457 |
end; |
|
458 |
3: begin |
|
459 |
val(ParamStr(2), ipcPort); |
|
460 |
GameType:= gmtLandPreview; |
|
461 |
if ParamStr(3) <> 'landpreview' then |
|
462 |
OutError(errmsgShouldntRun, true); |
|
463 |
end; |
|
464 |
2: begin |
|
465 |
PathPrefix:= ParamStr(1); |
|
466 |
recordFileName:= ParamStr(2); |
|
467 |
end; |
|
468 |
6: begin |
|
469 |
PathPrefix:= ParamStr(1); |
|
470 |
recordFileName:= ParamStr(2); |
|
471 |
||
472 |
if ParamStr(3) = '--set-video' then |
|
2008 | 473 |
begin |
2698 | 474 |
val(ParamStr(4), cScreenWidth); |
475 |
val(ParamStr(5), cScreenHeight); |
|
476 |
cInitWidth:= cScreenWidth; |
|
477 |
cInitHeight:= cScreenHeight; |
|
478 |
cBitsStr:= ParamStr(6); |
|
479 |
val(cBitsStr, cBits); |
|
2008 | 480 |
end |
481 |
else |
|
482 |
begin |
|
2698 | 483 |
if ParamStr(3) = '--set-audio' then |
484 |
begin |
|
485 |
val(ParamStr(4), cInitVolume); |
|
486 |
isMusicEnabled:= ParamStr(5) = '1'; |
|
487 |
isSoundEnabled:= ParamStr(6) = '1'; |
|
488 |
end |
|
489 |
else |
|
2008 | 490 |
begin |
2698 | 491 |
if ParamStr(3) = '--set-other' then |
492 |
begin |
|
493 |
cLocaleFName:= ParamStr(4); |
|
494 |
cFullScreen:= ParamStr(5) = '1'; |
|
495 |
cShowFPS:= ParamStr(6) = '1'; |
|
496 |
end |
|
497 |
else DisplayUsage; |
|
2008 | 498 |
end |
2698 | 499 |
end; |
2008 | 500 |
end; |
2698 | 501 |
11: begin |
502 |
PathPrefix:= ParamStr(1); |
|
503 |
recordFileName:= ParamStr(2); |
|
2376 | 504 |
|
2698 | 505 |
if ParamStr(3) = '--set-multimedia' then |
506 |
begin |
|
507 |
val(ParamStr(4), cScreenWidth); |
|
508 |
val(ParamStr(5), cScreenHeight); |
|
509 |
cInitWidth:= cScreenWidth; |
|
510 |
cInitHeight:= cScreenHeight; |
|
511 |
cBitsStr:= ParamStr(6); |
|
512 |
val(cBitsStr, cBits); |
|
513 |
val(ParamStr(7), cInitVolume); |
|
514 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
515 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
516 |
cLocaleFName:= ParamStr(10); |
|
517 |
cFullScreen:= ParamStr(11) = '1'; |
|
518 |
end |
|
519 |
else DisplayUsage; |
|
520 |
end; |
|
521 |
15: begin |
|
522 |
PathPrefix:= ParamStr(1); |
|
523 |
recordFileName:= ParamStr(2); |
|
524 |
if ParamStr(3) = '--set-everything' then |
|
525 |
begin |
|
526 |
val(ParamStr(4), cScreenWidth); |
|
527 |
val(ParamStr(5), cScreenHeight); |
|
528 |
cInitWidth:= cScreenWidth; |
|
529 |
cInitHeight:= cScreenHeight; |
|
530 |
cBitsStr:= ParamStr(6); |
|
531 |
val(cBitsStr, cBits); |
|
532 |
val(ParamStr(7), cInitVolume); |
|
533 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
534 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
535 |
cLocaleFName:= ParamStr(10); |
|
536 |
cFullScreen:= ParamStr(11) = '1'; |
|
537 |
cAltDamage:= ParamStr(12) = '1'; |
|
538 |
cShowFPS:= ParamStr(13) = '1'; |
|
539 |
val(ParamStr(14), cTimerInterval); |
|
540 |
cReducedQuality:= ParamStr(15) = '1'; |
|
541 |
end |
|
542 |
else DisplayUsage; |
|
543 |
end; |
|
2008 | 544 |
else DisplayUsage; |
545 |
end; |
|
2630 | 546 |
|
547 |
{$IFDEF DEBUGFILE} |
|
2698 | 548 |
AddFileLog('Prefix: "' + PathPrefix +'"'); |
549 |
for i:= 0 to ParamCount do |
|
550 |
AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
|
2630 | 551 |
{$IFDEF IPHONEOS} |
2690 | 552 |
WriteLnToConsole('Saving debug file at: ' + IPH_getDocumentsPath()); |
2630 | 553 |
{$ENDIF} |
554 |
{$ENDIF} |
|
51 | 555 |
end; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
556 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
557 |
/////////////////////////////// m a i n //////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
558 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
559 |
|
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
560 |
begin |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
561 |
initEverything(); |
2692
ce9992075118
better network support + initial work for returning to frontend
koda
parents:
2691
diff
changeset
|
562 |
WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
563 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
564 |
GetParams(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
565 |
Randomize(); |
2008 | 566 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
567 |
if GameType = gmtLandPreview then GenLandPreview() |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
568 |
else Game(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
569 |
ExitCode:= 0; |
2698 | 570 |
{$ENDIF} |
51 | 571 |
end. |