author | nemo |
Tue, 26 Jan 2010 23:00:45 +0000 | |
changeset 2717 | 2b75ef82676d |
parent 2716 | b9ca1bfca24f |
child 2719 | 0efcaa69d30c |
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'); |
|
2717
2b75ef82676d
Alternate loading for koda's consideration. For case of pt_BR will try en, pt, then pt_BR
nemo
parents:
2716
diff
changeset
|
281 |
LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt'); |
2698 | 282 |
LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
283 |
||
284 |
if recordFileName = '' then |
|
285 |
SendIPCAndWaitReply('C') // ask for game config |
|
286 |
else |
|
287 |
LoadRecordFromFile(recordFileName); |
|
288 |
||
289 |
s:= 'eproto ' + inttostr(cNetProtoVersion); |
|
290 |
SendIPCRaw(@s[0], Length(s) + 1); // send proto version |
|
291 |
||
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
292 |
InitTeams(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
293 |
AssignStores(); |
2590 | 294 |
|
2698 | 295 |
if isSoundEnabled then |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
296 |
InitSound(); |
2698 | 297 |
|
298 |
isDeveloperMode:= false; |
|
299 |
||
300 |
TryDo(InitStepsFlags = cifAllInited, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
|
301 |
||
302 |
MainLoop(); |
|
303 |
OnDestroy(); |
|
304 |
exit(); |
|
305 |
end; |
|
2590 | 306 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
307 |
procedure initEverything; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
308 |
begin |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
309 |
init_uConsts(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
310 |
init_uMisc(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
311 |
init_uConsole(); // MUST happen after uMisc |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
312 |
|
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
313 |
init_uAI(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
314 |
//uAIActions does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
315 |
//uAIAmmoTests does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
316 |
init_uAIMisc(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
317 |
init_uAmmos(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
318 |
init_uChat(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
319 |
init_uCollisions(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
320 |
//uFloat does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
321 |
//uGame does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
322 |
init_uGears(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
323 |
init_uIO(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
324 |
init_uKeys(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
325 |
init_uLand(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
326 |
//uLandGraphics does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
327 |
//uLandObjects does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
328 |
//uLandTemplates does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
329 |
//uLandTexture does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
330 |
//uLocale does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
331 |
init_uRandom(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
332 |
//uSHA does not need initialization |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
333 |
init_uSound(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
334 |
init_uStats(); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
335 |
init_uStore(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
336 |
init_uTeams(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
337 |
init_uTriggers(); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
338 |
init_uVisualGears(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
339 |
init_uWorld(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
340 |
end; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
341 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
342 |
procedure freeEverything; |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
343 |
begin |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
344 |
free_uWorld(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
345 |
free_uVisualGears(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
346 |
free_uTriggers(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
347 |
free_uTeams(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
348 |
free_uStore(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
349 |
free_uStats(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
350 |
free_uSound(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
351 |
//uSHA does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
352 |
free_uRandom(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
353 |
//uLocale does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
354 |
//uLandTemplates does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
355 |
//uLandTexture does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
356 |
//uLandObjects does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
357 |
//uLandGraphics does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
358 |
free_uLand(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
359 |
free_uKeys(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
360 |
free_uIO(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
361 |
free_uGears(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
362 |
//uGame does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
363 |
//uFloat does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
364 |
free_uCollisions(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
365 |
free_uChat(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
366 |
free_uAmmos(); |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
367 |
free_uAIMisc(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
368 |
//uAIAmmoTests does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
369 |
//uAIActions does not need to be freed |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
370 |
free_uAI(); //stub |
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
371 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
372 |
free_uConsole(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
373 |
free_uMisc(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
374 |
free_uConsts(); //stub |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
375 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
376 |
end; |
2698 | 377 |
{$IFNDEF IPHONEOS} |
378 |
///////////////////////// |
|
379 |
procedure GenLandPreview; |
|
380 |
var Preview: TPreview; |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
381 |
h: byte; |
2698 | 382 |
begin |
383 |
InitIPC; |
|
384 |
IPCWaitPongEvent; |
|
385 |
TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
|
386 |
||
387 |
Preview:= GenPreview; |
|
388 |
WriteLnToConsole('Sending preview...'); |
|
389 |
SendIPCRaw(@Preview, sizeof(Preview)); |
|
390 |
h:= MaxHedgehogs; |
|
391 |
SendIPCRaw(@h, sizeof(h)); |
|
392 |
WriteLnToConsole('Preview sent, disconnect'); |
|
393 |
CloseIPC(); |
|
394 |
end; |
|
395 |
||
396 |
//////////////////////////////// |
|
397 |
procedure Resize(w, h: LongInt); |
|
398 |
begin |
|
399 |
cScreenWidth:= w; |
|
400 |
cScreenHeight:= h; |
|
401 |
if cFullScreen then |
|
402 |
ParseCommand('/fullscr 1', true) |
|
403 |
else |
|
404 |
ParseCommand('/fullscr 0', true); |
|
51 | 405 |
end; |
406 |
||
2008 | 407 |
///////////////////// |
408 |
procedure DisplayUsage; |
|
2691 | 409 |
var i: LongInt; |
2008 | 410 |
begin |
411 |
WriteLn('Wrong argument format: correct configurations is'); |
|
412 |
WriteLn(); |
|
413 |
WriteLn(' hwengine <path to data folder> <path to replay file> [option]'); |
|
414 |
WriteLn(); |
|
415 |
WriteLn('where [option] must be specified either as'); |
|
2264 | 416 |
WriteLn(' --set-video [screen width] [screen height] [color dept]'); |
2008 | 417 |
WriteLn(' --set-audio [volume] [enable music] [enable sounds]'); |
418 |
WriteLn(' --set-other [language file] [full screen] [show FPS]'); |
|
419 |
WriteLn(' --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]'); |
|
420 |
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]'); |
|
421 |
WriteLn(); |
|
2015 | 422 |
WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information'); |
2691 | 423 |
Write('parsed command: '); |
2698 | 424 |
for i:=0 to ParamCount do |
425 |
Write(ParamStr(i) + ' '); |
|
2691 | 426 |
WriteLn(); |
2015 | 427 |
halt(1); |
2008 | 428 |
end; |
429 |
||
51 | 430 |
//////////////////// |
431 |
procedure GetParams; |
|
267 | 432 |
{$IFDEF DEBUGFILE} |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
433 |
var i: LongInt; |
267 | 434 |
{$ENDIF} |
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
435 |
begin |
267 | 436 |
|
2698 | 437 |
case ParamCount of |
438 |
17: begin |
|
439 |
val(ParamStr(2), cScreenWidth); |
|
440 |
val(ParamStr(3), cScreenHeight); |
|
2008 | 441 |
cInitWidth:= cScreenWidth; |
442 |
cInitHeight:= cScreenHeight; |
|
2698 | 443 |
cBitsStr:= ParamStr(4); |
2008 | 444 |
val(cBitsStr, cBits); |
2698 | 445 |
val(ParamStr(5), ipcPort); |
446 |
cFullScreen:= ParamStr(6) = '1'; |
|
447 |
isSoundEnabled:= ParamStr(7) = '1'; |
|
448 |
cVSyncInUse:= ParamStr(8) = '1'; |
|
449 |
cLocaleFName:= ParamStr(9); |
|
450 |
val(ParamStr(10), cInitVolume); |
|
451 |
val(ParamStr(11), cTimerInterval); |
|
452 |
PathPrefix:= ParamStr(12); |
|
453 |
cShowFPS:= ParamStr(13) = '1'; |
|
454 |
cAltDamage:= ParamStr(14) = '1'; |
|
455 |
UserNick:= DecodeBase64(ParamStr(15)); |
|
456 |
isMusicEnabled:= ParamStr(16) = '1'; |
|
457 |
cReducedQuality:= ParamStr(17) = '1'; |
|
458 |
end; |
|
459 |
3: begin |
|
460 |
val(ParamStr(2), ipcPort); |
|
461 |
GameType:= gmtLandPreview; |
|
462 |
if ParamStr(3) <> 'landpreview' then |
|
463 |
OutError(errmsgShouldntRun, true); |
|
464 |
end; |
|
465 |
2: begin |
|
466 |
PathPrefix:= ParamStr(1); |
|
467 |
recordFileName:= ParamStr(2); |
|
468 |
end; |
|
469 |
6: begin |
|
470 |
PathPrefix:= ParamStr(1); |
|
471 |
recordFileName:= ParamStr(2); |
|
472 |
||
473 |
if ParamStr(3) = '--set-video' then |
|
2008 | 474 |
begin |
2698 | 475 |
val(ParamStr(4), cScreenWidth); |
476 |
val(ParamStr(5), cScreenHeight); |
|
477 |
cInitWidth:= cScreenWidth; |
|
478 |
cInitHeight:= cScreenHeight; |
|
479 |
cBitsStr:= ParamStr(6); |
|
480 |
val(cBitsStr, cBits); |
|
2008 | 481 |
end |
482 |
else |
|
483 |
begin |
|
2698 | 484 |
if ParamStr(3) = '--set-audio' then |
485 |
begin |
|
486 |
val(ParamStr(4), cInitVolume); |
|
487 |
isMusicEnabled:= ParamStr(5) = '1'; |
|
488 |
isSoundEnabled:= ParamStr(6) = '1'; |
|
489 |
end |
|
490 |
else |
|
2008 | 491 |
begin |
2698 | 492 |
if ParamStr(3) = '--set-other' then |
493 |
begin |
|
494 |
cLocaleFName:= ParamStr(4); |
|
495 |
cFullScreen:= ParamStr(5) = '1'; |
|
496 |
cShowFPS:= ParamStr(6) = '1'; |
|
497 |
end |
|
498 |
else DisplayUsage; |
|
2008 | 499 |
end |
2698 | 500 |
end; |
2008 | 501 |
end; |
2698 | 502 |
11: begin |
503 |
PathPrefix:= ParamStr(1); |
|
504 |
recordFileName:= ParamStr(2); |
|
2376 | 505 |
|
2698 | 506 |
if ParamStr(3) = '--set-multimedia' then |
507 |
begin |
|
508 |
val(ParamStr(4), cScreenWidth); |
|
509 |
val(ParamStr(5), cScreenHeight); |
|
510 |
cInitWidth:= cScreenWidth; |
|
511 |
cInitHeight:= cScreenHeight; |
|
512 |
cBitsStr:= ParamStr(6); |
|
513 |
val(cBitsStr, cBits); |
|
514 |
val(ParamStr(7), cInitVolume); |
|
515 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
516 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
517 |
cLocaleFName:= ParamStr(10); |
|
518 |
cFullScreen:= ParamStr(11) = '1'; |
|
519 |
end |
|
520 |
else DisplayUsage; |
|
521 |
end; |
|
522 |
15: begin |
|
523 |
PathPrefix:= ParamStr(1); |
|
524 |
recordFileName:= ParamStr(2); |
|
525 |
if ParamStr(3) = '--set-everything' then |
|
526 |
begin |
|
527 |
val(ParamStr(4), cScreenWidth); |
|
528 |
val(ParamStr(5), cScreenHeight); |
|
529 |
cInitWidth:= cScreenWidth; |
|
530 |
cInitHeight:= cScreenHeight; |
|
531 |
cBitsStr:= ParamStr(6); |
|
532 |
val(cBitsStr, cBits); |
|
533 |
val(ParamStr(7), cInitVolume); |
|
534 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
535 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
536 |
cLocaleFName:= ParamStr(10); |
|
537 |
cFullScreen:= ParamStr(11) = '1'; |
|
538 |
cAltDamage:= ParamStr(12) = '1'; |
|
539 |
cShowFPS:= ParamStr(13) = '1'; |
|
540 |
val(ParamStr(14), cTimerInterval); |
|
541 |
cReducedQuality:= ParamStr(15) = '1'; |
|
542 |
end |
|
543 |
else DisplayUsage; |
|
544 |
end; |
|
2008 | 545 |
else DisplayUsage; |
546 |
end; |
|
2630 | 547 |
|
548 |
{$IFDEF DEBUGFILE} |
|
2698 | 549 |
AddFileLog('Prefix: "' + PathPrefix +'"'); |
550 |
for i:= 0 to ParamCount do |
|
551 |
AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
|
2630 | 552 |
{$IFDEF IPHONEOS} |
2690 | 553 |
WriteLnToConsole('Saving debug file at: ' + IPH_getDocumentsPath()); |
2630 | 554 |
{$ENDIF} |
555 |
{$ENDIF} |
|
51 | 556 |
end; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
557 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
558 |
/////////////////////////////// m a i n //////////////////////////////////////// |
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 |
|
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
561 |
begin |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
562 |
initEverything(); |
2692
ce9992075118
better network support + initial work for returning to frontend
koda
parents:
2691
diff
changeset
|
563 |
WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); |
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
564 |
|
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
565 |
GetParams(); |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
566 |
Randomize(); |
2008 | 567 |
|
2699
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
568 |
if GameType = gmtLandPreview then GenLandPreview() |
249adefa9c1c
replace initialization/finalization statements with custom init functions
koda
parents:
2698
diff
changeset
|
569 |
else Game(); |
2716
b9ca1bfca24f
complete the replacement of init/free wrappers for every unit
koda
parents:
2715
diff
changeset
|
570 |
ExitCode:= 0; |
2698 | 571 |
{$ENDIF} |
51 | 572 |
end. |