author | koda |
Fri, 08 Jan 2010 03:52:44 +0000 | |
changeset 2688 | 174c94b8ea72 |
parent 2682 | d4c395f25db2 |
child 2689 | dfda97c153a4 |
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 |
|
51 | 21 |
program hwengine; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
22 |
uses |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
23 |
SDLh in 'SDLh.pas', |
2152 | 24 |
{$IFDEF GLES11} |
1906 | 25 |
gles11, |
26 |
{$ELSE} |
|
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
27 |
GL, |
1906 | 28 |
{$ENDIF} |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
29 |
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
|
30 |
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
|
31 |
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
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
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
|
38 |
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
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
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
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
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
|
55 |
uStats in 'uStats.pas', |
1807 | 56 |
uChat in 'uChat.pas', |
2008 | 57 |
uLandTexture in 'uLandTexture.pas'; |
51 | 58 |
|
59 |
// also: GSHandlers.inc |
|
60 |
// CCHandlers.inc |
|
61 |
// HHHandlers.inc |
|
357 | 62 |
// SinTable.inc |
271 | 63 |
// proto.inc |
51 | 64 |
|
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
65 |
var recordFileName : shortstring = ''; |
51 | 66 |
|
67 |
procedure OnDestroy; forward; |
|
68 |
||
69 |
//////////////////////////////// |
|
371 | 70 |
procedure DoTimer(Lag: LongInt); |
2243
b4764993f833
additional touch support and nemo's reduced land array size
koda
parents:
2191
diff
changeset
|
71 |
{$IFNDEF IPHONEOS} |
1080 | 72 |
var s: string; |
2243
b4764993f833
additional touch support and nemo's reduced land array size
koda
parents:
2191
diff
changeset
|
73 |
{$ENDIF} |
51 | 74 |
begin |
564 | 75 |
inc(RealTicks, Lag); |
76 |
||
51 | 77 |
case GameState of |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
78 |
gsLandGen: begin |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
79 |
GenMap; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
80 |
GameState:= gsStart; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
81 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
82 |
gsStart: begin |
1784 | 83 |
if HasBorder then DisableSomeWeapons; |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
84 |
AddClouds; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
85 |
AssignHHCoords; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
86 |
AddMiscGears; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
87 |
StoreLoad; |
2428 | 88 |
InitWorld; |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
89 |
ResetKbd; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
90 |
SoundLoad; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
91 |
if GameType = gmtSave then |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
92 |
begin |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
93 |
isSEBackup:= isSoundEnabled; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
94 |
isSoundEnabled:= false |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
95 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
96 |
FinishProgress; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
97 |
PlayMusic; |
2162 | 98 |
SetScale(zoom); |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
99 |
GameState:= gsGame |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
100 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
101 |
gsConfirm, |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
102 |
gsGame: begin |
1645 | 103 |
DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible |
1524
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
104 |
ProcessKbd; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
105 |
DoGameTick(Lag); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
106 |
ProcessVisualGears(Lag); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
107 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
108 |
gsChat: begin |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
109 |
DrawWorld(Lag); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
110 |
DoGameTick(Lag); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
111 |
ProcessVisualGears(Lag); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
112 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
113 |
gsExit: begin |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
114 |
OnDestroy; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
115 |
end; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
116 |
end; |
564 | 117 |
|
753 | 118 |
SDL_GL_SwapBuffers(); |
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
|
119 |
{$IFNDEF IPHONEOS} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
120 |
// not going to make captures on the iPhone (nor resizing) |
51 | 121 |
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
|
122 |
begin |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
123 |
flagMakeCapture:= false; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
124 |
s:= 'hw_' + cSeed + '_' + inttostr(GameTicks) + '.tga'; |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
125 |
WriteLnToConsole('Saving ' + s); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
126 |
MakeScreenshot(s); |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
127 |
// SDL_SaveBMP_RW(SDLPrimSurface, SDL_RWFromFile(Str2PChar(s), 'wb'), 1) |
5a652a465559
Draw world before processing gears, as this should improve performance by introducing cpu-gpu parallelizm
unc0rr
parents:
1128
diff
changeset
|
128 |
end; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
129 |
end; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
130 |
|
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
131 |
//////////////////////////////// |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
132 |
procedure Resize(w, h: LongInt); |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
133 |
begin |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
134 |
cScreenWidth:= w; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
135 |
cScreenHeight:= h; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
136 |
if cFullScreen then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
137 |
ParseCommand('/fullscr 1', true) |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
138 |
else |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
139 |
ParseCommand('/fullscr 0', true); |
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
|
140 |
{$ENDIF} |
51 | 141 |
end; |
142 |
||
143 |
//////////////////// |
|
79 | 144 |
procedure OnDestroy; |
51 | 145 |
begin |
146 |
{$IFDEF DEBUGFILE}AddFileLog('Freeing resources...');{$ENDIF} |
|
2688 | 147 |
if isSoundEnabled then ReleaseSound(); |
148 |
StoreRelease(); |
|
149 |
FreeLand(); |
|
150 |
SendKB(); |
|
151 |
CloseIPC(); |
|
152 |
TTF_Quit(); |
|
153 |
//{$IFNDEF IPHONEOS} |
|
154 |
// TODO: don't halt and don't clean, return to the previous view |
|
155 |
SDL_Quit(); |
|
156 |
halt(); |
|
157 |
//{$ENDIF} |
|
51 | 158 |
end; |
159 |
||
160 |
/////////////////// |
|
161 |
procedure MainLoop; |
|
162 |
var PrevTime, |
|
188 | 163 |
CurrTime: Longword; |
51 | 164 |
event: TSDL_Event; |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
165 |
{$IFDEF TOUCHINPUT} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
166 |
var tiltValue: LongInt; |
2569 | 167 |
{$ENDIF} |
51 | 168 |
begin |
169 |
PrevTime:= SDL_GetTicks; |
|
170 |
repeat |
|
171 |
while SDL_PollEvent(@event) <> 0 do |
|
1120 | 172 |
case event.type_ of |
2586
204e6b2885bc
added little/big endian checks, added symbol for touch input, simplified iphoneos definitions
koda
parents:
2581
diff
changeset
|
173 |
{$IFDEF SDL13} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
174 |
SDL_WINDOWEVENT: |
2390 | 175 |
{$ELSE} |
1120 | 176 |
SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode); |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
177 |
SDL_ACTIVEEVENT: |
2390 | 178 |
{$ENDIF} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
179 |
if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
1120 | 180 |
cHasFocus:= event.active.gain = 1; |
1127 | 181 |
//SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450)); |
2586
204e6b2885bc
added little/big endian checks, added symbol for touch input, simplified iphoneos definitions
koda
parents:
2581
diff
changeset
|
182 |
{$IFDEF IPHONEOS} |
2630 | 183 |
(* SDL_JOYAXISMOTION: begin |
2580
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
184 |
{* axis 0 = left and right; |
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
185 |
axis 1 = up and down; |
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
186 |
axis 2 = back and forth; *} |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
187 |
|
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
188 |
WriteLnToConsole('********************************************* accelerometer'); |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
189 |
|
2633 | 190 |
tiltValue:= SDL_JoystickGetAxis(uKeys.theJoystick, 0); |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
191 |
|
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
192 |
if (CurrentTeam <> nil) then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
193 |
begin |
2600 | 194 |
{$IFDEF DEBUGFILE} |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
195 |
AddFileLog('Joystick: 0; Axis: 0; Value: ' + inttostr(tiltValue)); |
2600 | 196 |
{$ENDIF} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
197 |
if tiltValue > 1500 then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
198 |
begin |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
199 |
uKeys.rightKey:= true; |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
200 |
uKeys.isWalking:= true; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
201 |
end |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
202 |
else |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
203 |
if tiltValue <= -1500 then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
204 |
begin |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
205 |
uKeys.leftKey:= true; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
206 |
uKeys.isWalking:= true; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
207 |
end |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
208 |
else |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
209 |
if (tiltValue > -1500) and (tiltValue <= 1500) and (movedbybuttons = false) then uKeys.isWalking:= false; |
2577 | 210 |
end; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
211 |
end;*) |
2567 | 212 |
{$ELSE} |
2379 | 213 |
SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then uKeys.wheelDown:= true; |
2667 | 214 |
SDL_MOUSEBUTTONUP: if event.button.button = SDL_BUTTON_WHEELUP then uKeys.wheelUp:= true; |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
215 |
SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value); |
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
216 |
SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
2428 | 217 |
SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
218 |
SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
|
2577 | 219 |
{$ENDIF} |
1120 | 220 |
SDL_QUITEV: isTerminated:= true |
2590 | 221 |
end; |
222 |
||
51 | 223 |
CurrTime:= SDL_GetTicks; |
224 |
if PrevTime + cTimerInterval <= CurrTime then |
|
225 |
begin |
|
226 |
DoTimer(CurrTime - PrevTime); |
|
227 |
PrevTime:= CurrTime |
|
434 | 228 |
end else SDL_Delay(1); |
51 | 229 |
IPCCheckSock |
230 |
until isTerminated |
|
2590 | 231 |
|
51 | 232 |
end; |
233 |
||
2008 | 234 |
///////////////////// |
235 |
procedure DisplayUsage; |
|
236 |
begin |
|
237 |
WriteLn('Wrong argument format: correct configurations is'); |
|
238 |
WriteLn(); |
|
239 |
WriteLn(' hwengine <path to data folder> <path to replay file> [option]'); |
|
240 |
WriteLn(); |
|
241 |
WriteLn('where [option] must be specified either as'); |
|
2264 | 242 |
WriteLn(' --set-video [screen width] [screen height] [color dept]'); |
2008 | 243 |
WriteLn(' --set-audio [volume] [enable music] [enable sounds]'); |
244 |
WriteLn(' --set-other [language file] [full screen] [show FPS]'); |
|
245 |
WriteLn(' --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]'); |
|
246 |
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]'); |
|
247 |
WriteLn(); |
|
2015 | 248 |
WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information'); |
249 |
halt(1); |
|
2008 | 250 |
end; |
251 |
||
51 | 252 |
//////////////////// |
253 |
procedure GetParams; |
|
889 | 254 |
var |
267 | 255 |
{$IFDEF DEBUGFILE} |
371 | 256 |
i: LongInt; |
267 | 257 |
{$ENDIF} |
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
258 |
p: TPathType; |
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
259 |
begin |
267 | 260 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
261 |
case ParamCount of |
2392
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
262 |
17: begin |
498 | 263 |
val(ParamStr(2), cScreenWidth); |
264 |
val(ParamStr(3), cScreenHeight); |
|
1121
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1120
diff
changeset
|
265 |
cInitWidth:= cScreenWidth; |
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1120
diff
changeset
|
266 |
cInitHeight:= cScreenHeight; |
497 | 267 |
cBitsStr:= ParamStr(4); |
498 | 268 |
val(cBitsStr, cBits); |
269 |
val(ParamStr(5), ipcPort); |
|
497 | 270 |
cFullScreen:= ParamStr(6) = '1'; |
271 |
isSoundEnabled:= ParamStr(7) = '1'; |
|
2671
7e0f88013fe8
smaller patches, one missing Sky-lowres, IMG_Init and Mix_Init (might require newer libraries), updates to SDL bindings, code cleanup, new compile flags
koda
parents:
2669
diff
changeset
|
272 |
cVSyncInUse:= ParamStr(8) = '1'; |
2392
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
273 |
cLocaleFName:= ParamStr(9); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
274 |
val(ParamStr(10), cInitVolume); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
275 |
val(ParamStr(11), cTimerInterval); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
276 |
PathPrefix:= ParamStr(12); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
277 |
cShowFPS:= ParamStr(13) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
278 |
cAltDamage:= ParamStr(14) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
279 |
UserNick:= DecodeBase64(ParamStr(15)); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
280 |
isMusicEnabled:= ParamStr(16) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
281 |
cReducedQuality:= ParamStr(17) = '1'; |
267 | 282 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
949 | 283 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
284 |
end; |
2390 | 285 |
{$IFDEF IPHONEOS} |
2252 | 286 |
0: begin |
2663 | 287 |
PathPrefix:= 'Data'; |
288 |
recordFileName:= 'save.hws'; |
|
2630 | 289 |
val('320', cScreenWidth); |
290 |
val('480', cScreenHeight); |
|
291 |
cInitWidth:= cScreenWidth; |
|
292 |
cInitHeight:= cScreenHeight; |
|
293 |
cBitsStr:= '32'; |
|
294 |
val(cBitsStr, cBits); |
|
295 |
val('100', cInitVolume); |
|
296 |
isMusicEnabled:= false; |
|
297 |
isSoundEnabled:= false; |
|
298 |
cLocaleFName:= 'en.txt'; |
|
299 |
cFullScreen:= true; //T or F is is the same here |
|
300 |
cAltDamage:= false; |
|
301 |
cShowFPS:= true; |
|
302 |
val('8', cTimerInterval); |
|
303 |
cReducedQuality:= false; |
|
2252 | 304 |
|
305 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
|
2630 | 306 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
2252 | 307 |
end; |
2390 | 308 |
{$ENDIF} |
497 | 309 |
3: begin |
498 | 310 |
val(ParamStr(2), ipcPort); |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
311 |
GameType:= gmtLandPreview; |
497 | 312 |
if ParamStr(3) <> 'landpreview' then OutError(errmsgShouldntRun, true); |
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
313 |
end; |
2008 | 314 |
2: begin |
315 |
PathPrefix:= ParamStr(1); |
|
316 |
recordFileName:= ParamStr(2); |
|
2376 | 317 |
|
2008 | 318 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
319 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
2630 | 320 |
end; |
2008 | 321 |
6: begin |
322 |
PathPrefix:= ParamStr(1); |
|
323 |
recordFileName:= ParamStr(2); |
|
2376 | 324 |
|
2008 | 325 |
if ParamStr(3) = '--set-video' then |
326 |
begin |
|
327 |
val(ParamStr(4), cScreenWidth); |
|
328 |
val(ParamStr(5), cScreenHeight); |
|
329 |
cInitWidth:= cScreenWidth; |
|
330 |
cInitHeight:= cScreenHeight; |
|
331 |
cBitsStr:= ParamStr(6); |
|
332 |
val(cBitsStr, cBits); |
|
333 |
end |
|
334 |
else |
|
335 |
begin |
|
336 |
if ParamStr(3) = '--set-audio' then |
|
337 |
begin |
|
338 |
val(ParamStr(4), cInitVolume); |
|
339 |
isMusicEnabled:= ParamStr(5) = '1'; |
|
340 |
isSoundEnabled:= ParamStr(6) = '1'; |
|
341 |
end |
|
342 |
else |
|
343 |
begin |
|
344 |
if ParamStr(3) = '--set-other' then |
|
345 |
begin |
|
346 |
cLocaleFName:= ParamStr(4); |
|
347 |
cFullScreen:= ParamStr(5) = '1'; |
|
348 |
cShowFPS:= ParamStr(6) = '1'; |
|
349 |
end |
|
350 |
else DisplayUsage; |
|
351 |
end |
|
352 |
end; |
|
2376 | 353 |
|
2008 | 354 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
355 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
356 |
end; |
|
357 |
11: begin |
|
358 |
PathPrefix:= ParamStr(1); |
|
359 |
recordFileName:= ParamStr(2); |
|
2376 | 360 |
|
2008 | 361 |
if ParamStr(3) = '--set-multimedia' then |
362 |
begin |
|
363 |
val(ParamStr(4), cScreenWidth); |
|
364 |
val(ParamStr(5), cScreenHeight); |
|
365 |
cInitWidth:= cScreenWidth; |
|
366 |
cInitHeight:= cScreenHeight; |
|
367 |
cBitsStr:= ParamStr(6); |
|
368 |
val(cBitsStr, cBits); |
|
369 |
val(ParamStr(7), cInitVolume); |
|
370 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
371 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
372 |
cLocaleFName:= ParamStr(10); |
|
373 |
cFullScreen:= ParamStr(11) = '1'; |
|
374 |
end |
|
375 |
else DisplayUsage; |
|
2376 | 376 |
|
2008 | 377 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
378 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
379 |
end; |
|
380 |
15: begin |
|
2154
3d2917be12c3
Change default output to stderr since /tmp doesn't exist under windows and is useless under iphoneos, add a couple of extra parameters
nemo
parents:
2152
diff
changeset
|
381 |
PathPrefix:= ParamStr(1); |
3d2917be12c3
Change default output to stderr since /tmp doesn't exist under windows and is useless under iphoneos, add a couple of extra parameters
nemo
parents:
2152
diff
changeset
|
382 |
recordFileName:= ParamStr(2); |
2008 | 383 |
if ParamStr(3) = '--set-everything' then |
384 |
begin |
|
385 |
val(ParamStr(4), cScreenWidth); |
|
386 |
val(ParamStr(5), cScreenHeight); |
|
387 |
cInitWidth:= cScreenWidth; |
|
388 |
cInitHeight:= cScreenHeight; |
|
389 |
cBitsStr:= ParamStr(6); |
|
390 |
val(cBitsStr, cBits); |
|
391 |
val(ParamStr(7), cInitVolume); |
|
392 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
393 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
394 |
cLocaleFName:= ParamStr(10); |
|
395 |
cFullScreen:= ParamStr(11) = '1'; |
|
396 |
cAltDamage:= ParamStr(12) = '1'; |
|
397 |
cShowFPS:= ParamStr(13) = '1'; |
|
398 |
val(ParamStr(14), cTimerInterval); |
|
399 |
cReducedQuality:= ParamStr(15) = '1'; |
|
400 |
end |
|
401 |
else DisplayUsage; |
|
2376 | 402 |
|
2008 | 403 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
404 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
405 |
end; |
|
406 |
else DisplayUsage; |
|
407 |
end; |
|
2630 | 408 |
|
409 |
{$IFDEF DEBUGFILE} |
|
410 |
AddFileLog('Prefix: "' + PathPrefix +'"'); |
|
411 |
for i:= 0 to ParamCount do |
|
412 |
AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
|
413 |
{$IFDEF IPHONEOS} |
|
2633 | 414 |
WriteLnToConsole('Saving debug file at: ' + get_documents_path()); |
2630 | 415 |
{$ENDIF} |
416 |
{$ENDIF} |
|
51 | 417 |
end; |
418 |
||
2016 | 419 |
///////////////////////// |
51 | 420 |
procedure ShowMainWindow; |
421 |
begin |
|
2633 | 422 |
if cFullScreen then ParseCommand('fullscr 1', true) |
423 |
else ParseCommand('fullscr 0', true); |
|
424 |
SDL_ShowCursor(0) |
|
51 | 425 |
end; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
426 |
|
160 | 427 |
/////////////// |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
428 |
procedure Game; |
205 | 429 |
var s: shortstring; |
51 | 430 |
begin |
431 |
WriteToConsole('Init SDL... '); |
|
2674
2fce032f2f95
lupdate + Palewolf's updated spanish translation + other patches of mine
koda
parents:
2671
diff
changeset
|
432 |
SDLTry(SDL_Init(SDL_INIT_VIDEO) >= 0, true); |
51 | 433 |
WriteLnToConsole(msgOK); |
753 | 434 |
|
377 | 435 |
SDL_EnableUNICODE(1); |
51 | 436 |
|
437 |
WriteToConsole('Init SDL_ttf... '); |
|
200 | 438 |
SDLTry(TTF_Init <> -1, true); |
51 | 439 |
WriteLnToConsole(msgOK); |
440 |
||
441 |
ShowMainWindow; |
|
442 |
||
2671
7e0f88013fe8
smaller patches, one missing Sky-lowres, IMG_Init and Mix_Init (might require newer libraries), updates to SDL bindings, code cleanup, new compile flags
koda
parents:
2669
diff
changeset
|
443 |
AddProgress; |
7e0f88013fe8
smaller patches, one missing Sky-lowres, IMG_Init and Mix_Init (might require newer libraries), updates to SDL bindings, code cleanup, new compile flags
koda
parents:
2669
diff
changeset
|
444 |
|
2428 | 445 |
ControllerInit; // has to happen before InitKbdKeyTable to map keys |
51 | 446 |
InitKbdKeyTable; |
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
447 |
|
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
448 |
if recordFileName = '' then InitIPC; |
51 | 449 |
WriteLnToConsole(msgGettingConfig); |
80 | 450 |
|
2039 | 451 |
if cLocaleFName <> 'en.txt' then |
452 |
LoadLocale(Pathz[ptLocale] + '/en.txt'); |
|
80 | 453 |
LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
454 |
||
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
455 |
if recordFileName = '' then |
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
456 |
SendIPCAndWaitReply('C') // ask for game config |
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
457 |
else |
2600 | 458 |
LoadRecordFromFile(recordFileName); |
205 | 459 |
|
460 |
s:= 'eproto ' + inttostr(cNetProtoVersion); |
|
461 |
SendIPCRaw(@s[0], Length(s) + 1); // send proto version |
|
462 |
||
51 | 463 |
InitTeams; |
288 | 464 |
AssignStores; |
51 | 465 |
|
2600 | 466 |
if isSoundEnabled then |
467 |
InitSound; |
|
51 | 468 |
|
469 |
isDeveloperMode:= false; |
|
470 |
||
2600 | 471 |
TryDo(InitStepsFlags = cifAllInited, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
55
e09f7c952a40
Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents:
54
diff
changeset
|
472 |
|
2428 | 473 |
MainLoop; |
474 |
ControllerClose |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
475 |
end; |
51 | 476 |
|
160 | 477 |
///////////////////////// |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
478 |
procedure GenLandPreview; |
566 | 479 |
var Preview: TPreview; |
1791
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
480 |
h: byte; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
481 |
begin |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
482 |
InitIPC; |
159 | 483 |
IPCWaitPongEvent; |
2600 | 484 |
TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
160 | 485 |
|
566 | 486 |
Preview:= GenPreview; |
159 | 487 |
WriteLnToConsole('Sending preview...'); |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
488 |
SendIPCRaw(@Preview, sizeof(Preview)); |
1791
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
489 |
h:= MaxHedgehogs; |
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
490 |
SendIPCRaw(@h, sizeof(h)); |
159 | 491 |
WriteLnToConsole('Preview sent, disconnect'); |
158 | 492 |
CloseIPC |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
493 |
end; |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
494 |
|
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
495 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
496 |
/////////////////////////////// m a i n //////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
497 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
498 |
|
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
499 |
begin |
2667 | 500 |
WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')'); |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
501 |
GetParams; |
2105 | 502 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
503 |
Randomize; |
2008 | 504 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
505 |
if GameType = gmtLandPreview then GenLandPreview |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
506 |
else Game |
51 | 507 |
end. |
2008 | 508 |