author | koda |
Fri, 08 Jan 2010 03:38:01 +0000 | |
changeset 2687 | 28b8330b8af1 |
parent 2682 | d4c395f25db2 |
child 2688 | 174c94b8ea72 |
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} |
|
147 |
if isSoundEnabled then ReleaseSound; |
|
619 | 148 |
StoreRelease; |
1807 | 149 |
FreeLand; |
619 | 150 |
SendKB; |
51 | 151 |
CloseIPC; |
152 |
TTF_Quit; |
|
153 |
SDL_Quit; |
|
154 |
halt |
|
155 |
end; |
|
156 |
||
157 |
/////////////////// |
|
158 |
procedure MainLoop; |
|
159 |
var PrevTime, |
|
188 | 160 |
CurrTime: Longword; |
51 | 161 |
event: TSDL_Event; |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
162 |
{$IFDEF TOUCHINPUT} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
163 |
var tiltValue: LongInt; |
2569 | 164 |
{$ENDIF} |
51 | 165 |
begin |
166 |
PrevTime:= SDL_GetTicks; |
|
167 |
repeat |
|
168 |
while SDL_PollEvent(@event) <> 0 do |
|
1120 | 169 |
case event.type_ of |
2586
204e6b2885bc
added little/big endian checks, added symbol for touch input, simplified iphoneos definitions
koda
parents:
2581
diff
changeset
|
170 |
{$IFDEF SDL13} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
171 |
SDL_WINDOWEVENT: |
2390 | 172 |
{$ELSE} |
1120 | 173 |
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
|
174 |
SDL_ACTIVEEVENT: |
2390 | 175 |
{$ENDIF} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
176 |
if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
1120 | 177 |
cHasFocus:= event.active.gain = 1; |
1127 | 178 |
//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
|
179 |
{$IFDEF IPHONEOS} |
2630 | 180 |
(* SDL_JOYAXISMOTION: begin |
2580
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
181 |
{* axis 0 = left and right; |
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
182 |
axis 1 = up and down; |
aeccc8f51d3f
completes touch input/control (problems with moving camera)
koda
parents:
2579
diff
changeset
|
183 |
axis 2 = back and forth; *} |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
184 |
|
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
185 |
WriteLnToConsole('********************************************* accelerometer'); |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
186 |
|
2633 | 187 |
tiltValue:= SDL_JoystickGetAxis(uKeys.theJoystick, 0); |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
188 |
|
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
189 |
if (CurrentTeam <> nil) then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
190 |
begin |
2600 | 191 |
{$IFDEF DEBUGFILE} |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
192 |
AddFileLog('Joystick: 0; Axis: 0; Value: ' + inttostr(tiltValue)); |
2600 | 193 |
{$ENDIF} |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
194 |
if tiltValue > 1500 then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
195 |
begin |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
196 |
uKeys.rightKey:= true; |
2591
c6597b65caea
other controls implementation + sdlh revisited (once again)
koda
parents:
2590
diff
changeset
|
197 |
uKeys.isWalking:= true; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
198 |
end |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
199 |
else |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
200 |
if tiltValue <= -1500 then |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
201 |
begin |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
202 |
uKeys.leftKey:= true; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
203 |
uKeys.isWalking:= true; |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
204 |
end |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
205 |
else |
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
206 |
if (tiltValue > -1500) and (tiltValue <= 1500) and (movedbybuttons = false) then uKeys.isWalking:= false; |
2577 | 207 |
end; |
2678
334016e8d895
injection of custom code in SDL for iPhone in order to implement our frontend
koda
parents:
2677
diff
changeset
|
208 |
end;*) |
2567 | 209 |
{$ELSE} |
2379 | 210 |
SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then uKeys.wheelDown:= true; |
2667 | 211 |
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
|
212 |
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
|
213 |
SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value); |
2428 | 214 |
SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true); |
215 |
SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false); |
|
2577 | 216 |
{$ENDIF} |
1120 | 217 |
SDL_QUITEV: isTerminated:= true |
2590 | 218 |
end; |
219 |
||
51 | 220 |
CurrTime:= SDL_GetTicks; |
221 |
if PrevTime + cTimerInterval <= CurrTime then |
|
222 |
begin |
|
223 |
DoTimer(CurrTime - PrevTime); |
|
224 |
PrevTime:= CurrTime |
|
434 | 225 |
end else SDL_Delay(1); |
51 | 226 |
IPCCheckSock |
227 |
until isTerminated |
|
2590 | 228 |
|
51 | 229 |
end; |
230 |
||
2008 | 231 |
///////////////////// |
232 |
procedure DisplayUsage; |
|
233 |
begin |
|
234 |
WriteLn('Wrong argument format: correct configurations is'); |
|
235 |
WriteLn(); |
|
236 |
WriteLn(' hwengine <path to data folder> <path to replay file> [option]'); |
|
237 |
WriteLn(); |
|
238 |
WriteLn('where [option] must be specified either as'); |
|
2264 | 239 |
WriteLn(' --set-video [screen width] [screen height] [color dept]'); |
2008 | 240 |
WriteLn(' --set-audio [volume] [enable music] [enable sounds]'); |
241 |
WriteLn(' --set-other [language file] [full screen] [show FPS]'); |
|
242 |
WriteLn(' --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]'); |
|
243 |
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]'); |
|
244 |
WriteLn(); |
|
2015 | 245 |
WriteLn('Read documentation online at http://www.hedgewars.org/node/1465 for more information'); |
246 |
halt(1); |
|
2008 | 247 |
end; |
248 |
||
51 | 249 |
//////////////////// |
250 |
procedure GetParams; |
|
889 | 251 |
var |
267 | 252 |
{$IFDEF DEBUGFILE} |
371 | 253 |
i: LongInt; |
267 | 254 |
{$ENDIF} |
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
255 |
p: TPathType; |
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
81
diff
changeset
|
256 |
begin |
267 | 257 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
258 |
case ParamCount of |
2392
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
259 |
17: begin |
498 | 260 |
val(ParamStr(2), cScreenWidth); |
261 |
val(ParamStr(3), cScreenHeight); |
|
1121
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1120
diff
changeset
|
262 |
cInitWidth:= cScreenWidth; |
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1120
diff
changeset
|
263 |
cInitHeight:= cScreenHeight; |
497 | 264 |
cBitsStr:= ParamStr(4); |
498 | 265 |
val(cBitsStr, cBits); |
266 |
val(ParamStr(5), ipcPort); |
|
497 | 267 |
cFullScreen:= ParamStr(6) = '1'; |
268 |
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
|
269 |
cVSyncInUse:= ParamStr(8) = '1'; |
2392
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
270 |
cLocaleFName:= ParamStr(9); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
271 |
val(ParamStr(10), cInitVolume); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
272 |
val(ParamStr(11), cTimerInterval); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
273 |
PathPrefix:= ParamStr(12); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
274 |
cShowFPS:= ParamStr(13) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
275 |
cAltDamage:= ParamStr(14) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
276 |
UserNick:= DecodeBase64(ParamStr(15)); |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
277 |
isMusicEnabled:= ParamStr(16) = '1'; |
a55dbef5cf31
Smaxx's patch fixing openal sound issues with poor card drivers
koda
parents:
2390
diff
changeset
|
278 |
cReducedQuality:= ParamStr(17) = '1'; |
267 | 279 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
949 | 280 |
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
|
281 |
end; |
2390 | 282 |
{$IFDEF IPHONEOS} |
2252 | 283 |
0: begin |
2663 | 284 |
PathPrefix:= 'Data'; |
285 |
recordFileName:= 'save.hws'; |
|
2630 | 286 |
val('320', cScreenWidth); |
287 |
val('480', cScreenHeight); |
|
288 |
cInitWidth:= cScreenWidth; |
|
289 |
cInitHeight:= cScreenHeight; |
|
290 |
cBitsStr:= '32'; |
|
291 |
val(cBitsStr, cBits); |
|
292 |
val('100', cInitVolume); |
|
293 |
isMusicEnabled:= false; |
|
294 |
isSoundEnabled:= false; |
|
295 |
cLocaleFName:= 'en.txt'; |
|
296 |
cFullScreen:= true; //T or F is is the same here |
|
297 |
cAltDamage:= false; |
|
298 |
cShowFPS:= true; |
|
299 |
val('8', cTimerInterval); |
|
300 |
cReducedQuality:= false; |
|
2252 | 301 |
|
302 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
|
2630 | 303 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
2252 | 304 |
end; |
2390 | 305 |
{$ENDIF} |
497 | 306 |
3: begin |
498 | 307 |
val(ParamStr(2), ipcPort); |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
308 |
GameType:= gmtLandPreview; |
497 | 309 |
if ParamStr(3) <> 'landpreview' then OutError(errmsgShouldntRun, true); |
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
310 |
end; |
2008 | 311 |
2: begin |
312 |
PathPrefix:= ParamStr(1); |
|
313 |
recordFileName:= ParamStr(2); |
|
2376 | 314 |
|
2008 | 315 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
316 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
2630 | 317 |
end; |
2008 | 318 |
6: begin |
319 |
PathPrefix:= ParamStr(1); |
|
320 |
recordFileName:= ParamStr(2); |
|
2376 | 321 |
|
2008 | 322 |
if ParamStr(3) = '--set-video' then |
323 |
begin |
|
324 |
val(ParamStr(4), cScreenWidth); |
|
325 |
val(ParamStr(5), cScreenHeight); |
|
326 |
cInitWidth:= cScreenWidth; |
|
327 |
cInitHeight:= cScreenHeight; |
|
328 |
cBitsStr:= ParamStr(6); |
|
329 |
val(cBitsStr, cBits); |
|
330 |
end |
|
331 |
else |
|
332 |
begin |
|
333 |
if ParamStr(3) = '--set-audio' then |
|
334 |
begin |
|
335 |
val(ParamStr(4), cInitVolume); |
|
336 |
isMusicEnabled:= ParamStr(5) = '1'; |
|
337 |
isSoundEnabled:= ParamStr(6) = '1'; |
|
338 |
end |
|
339 |
else |
|
340 |
begin |
|
341 |
if ParamStr(3) = '--set-other' then |
|
342 |
begin |
|
343 |
cLocaleFName:= ParamStr(4); |
|
344 |
cFullScreen:= ParamStr(5) = '1'; |
|
345 |
cShowFPS:= ParamStr(6) = '1'; |
|
346 |
end |
|
347 |
else DisplayUsage; |
|
348 |
end |
|
349 |
end; |
|
2376 | 350 |
|
2008 | 351 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
352 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
353 |
end; |
|
354 |
11: begin |
|
355 |
PathPrefix:= ParamStr(1); |
|
356 |
recordFileName:= ParamStr(2); |
|
2376 | 357 |
|
2008 | 358 |
if ParamStr(3) = '--set-multimedia' then |
359 |
begin |
|
360 |
val(ParamStr(4), cScreenWidth); |
|
361 |
val(ParamStr(5), cScreenHeight); |
|
362 |
cInitWidth:= cScreenWidth; |
|
363 |
cInitHeight:= cScreenHeight; |
|
364 |
cBitsStr:= ParamStr(6); |
|
365 |
val(cBitsStr, cBits); |
|
366 |
val(ParamStr(7), cInitVolume); |
|
367 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
368 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
369 |
cLocaleFName:= ParamStr(10); |
|
370 |
cFullScreen:= ParamStr(11) = '1'; |
|
371 |
end |
|
372 |
else DisplayUsage; |
|
2376 | 373 |
|
2008 | 374 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
375 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
376 |
end; |
|
377 |
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
|
378 |
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
|
379 |
recordFileName:= ParamStr(2); |
2008 | 380 |
if ParamStr(3) = '--set-everything' then |
381 |
begin |
|
382 |
val(ParamStr(4), cScreenWidth); |
|
383 |
val(ParamStr(5), cScreenHeight); |
|
384 |
cInitWidth:= cScreenWidth; |
|
385 |
cInitHeight:= cScreenHeight; |
|
386 |
cBitsStr:= ParamStr(6); |
|
387 |
val(cBitsStr, cBits); |
|
388 |
val(ParamStr(7), cInitVolume); |
|
389 |
isMusicEnabled:= ParamStr(8) = '1'; |
|
390 |
isSoundEnabled:= ParamStr(9) = '1'; |
|
391 |
cLocaleFName:= ParamStr(10); |
|
392 |
cFullScreen:= ParamStr(11) = '1'; |
|
393 |
cAltDamage:= ParamStr(12) = '1'; |
|
394 |
cShowFPS:= ParamStr(13) = '1'; |
|
395 |
val(ParamStr(14), cTimerInterval); |
|
396 |
cReducedQuality:= ParamStr(15) = '1'; |
|
397 |
end |
|
398 |
else DisplayUsage; |
|
2376 | 399 |
|
2008 | 400 |
for p:= Succ(Low(TPathType)) to High(TPathType) do |
401 |
if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p] |
|
402 |
end; |
|
403 |
else DisplayUsage; |
|
404 |
end; |
|
2630 | 405 |
|
406 |
{$IFDEF DEBUGFILE} |
|
407 |
AddFileLog('Prefix: "' + PathPrefix +'"'); |
|
408 |
for i:= 0 to ParamCount do |
|
409 |
AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
|
410 |
{$IFDEF IPHONEOS} |
|
2633 | 411 |
WriteLnToConsole('Saving debug file at: ' + get_documents_path()); |
2630 | 412 |
{$ENDIF} |
413 |
{$ENDIF} |
|
51 | 414 |
end; |
415 |
||
2016 | 416 |
///////////////////////// |
51 | 417 |
procedure ShowMainWindow; |
418 |
begin |
|
2633 | 419 |
if cFullScreen then ParseCommand('fullscr 1', true) |
420 |
else ParseCommand('fullscr 0', true); |
|
421 |
SDL_ShowCursor(0) |
|
51 | 422 |
end; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
423 |
|
160 | 424 |
/////////////// |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
425 |
procedure Game; |
205 | 426 |
var s: shortstring; |
51 | 427 |
begin |
428 |
WriteToConsole('Init SDL... '); |
|
2674
2fce032f2f95
lupdate + Palewolf's updated spanish translation + other patches of mine
koda
parents:
2671
diff
changeset
|
429 |
SDLTry(SDL_Init(SDL_INIT_VIDEO) >= 0, true); |
51 | 430 |
WriteLnToConsole(msgOK); |
753 | 431 |
|
377 | 432 |
SDL_EnableUNICODE(1); |
51 | 433 |
|
434 |
WriteToConsole('Init SDL_ttf... '); |
|
200 | 435 |
SDLTry(TTF_Init <> -1, true); |
51 | 436 |
WriteLnToConsole(msgOK); |
437 |
||
438 |
ShowMainWindow; |
|
439 |
||
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
|
440 |
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
|
441 |
|
2428 | 442 |
ControllerInit; // has to happen before InitKbdKeyTable to map keys |
51 | 443 |
InitKbdKeyTable; |
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
444 |
|
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
445 |
if recordFileName = '' then InitIPC; |
51 | 446 |
WriteLnToConsole(msgGettingConfig); |
80 | 447 |
|
2039 | 448 |
if cLocaleFName <> 'en.txt' then |
449 |
LoadLocale(Pathz[ptLocale] + '/en.txt'); |
|
80 | 450 |
LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); |
451 |
||
1888
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
452 |
if recordFileName = '' then |
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
453 |
SendIPCAndWaitReply('C') // ask for game config |
e76274ce7365
Add an ability to run engine without IPC connection.
unc0rr
parents:
1825
diff
changeset
|
454 |
else |
2600 | 455 |
LoadRecordFromFile(recordFileName); |
205 | 456 |
|
457 |
s:= 'eproto ' + inttostr(cNetProtoVersion); |
|
458 |
SendIPCRaw(@s[0], Length(s) + 1); // send proto version |
|
459 |
||
51 | 460 |
InitTeams; |
288 | 461 |
AssignStores; |
51 | 462 |
|
2600 | 463 |
if isSoundEnabled then |
464 |
InitSound; |
|
51 | 465 |
|
466 |
isDeveloperMode:= false; |
|
467 |
||
2600 | 468 |
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
|
469 |
|
2428 | 470 |
MainLoop; |
471 |
ControllerClose |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
472 |
end; |
51 | 473 |
|
160 | 474 |
///////////////////////// |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
475 |
procedure GenLandPreview; |
566 | 476 |
var Preview: TPreview; |
1791
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
477 |
h: byte; |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
478 |
begin |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
479 |
InitIPC; |
159 | 480 |
IPCWaitPongEvent; |
2600 | 481 |
TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true); |
160 | 482 |
|
566 | 483 |
Preview:= GenPreview; |
159 | 484 |
WriteLnToConsole('Sending preview...'); |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
485 |
SendIPCRaw(@Preview, sizeof(Preview)); |
1791
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
486 |
h:= MaxHedgehogs; |
7c9d645d2591
Fix passing hedgehogs number from engine to frontend
unc0rr
parents:
1784
diff
changeset
|
487 |
SendIPCRaw(@h, sizeof(h)); |
159 | 488 |
WriteLnToConsole('Preview sent, disconnect'); |
158 | 489 |
CloseIPC |
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
490 |
end; |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
491 |
|
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
492 |
//////////////////////////////////////////////////////////////////////////////// |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
493 |
/////////////////////////////// m a i n //////////////////////////////////////// |
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 |
begin |
2667 | 497 |
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
|
498 |
GetParams; |
2105 | 499 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
500 |
Randomize; |
2008 | 501 |
|
155
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
502 |
if GameType = gmtLandPreview then GenLandPreview |
401f4ea24715
Engine can generate land preview and send it via IPC
unc0rr
parents:
109
diff
changeset
|
503 |
else Game |
51 | 504 |
end. |
2008 | 505 |