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