11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. |
12 * GNU General Public License for more details. |
13 * |
13 * |
14 * You should have received a copy of the GNU General Public License |
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 |
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 |
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
17 *) |
17 *) |
18 |
18 |
19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uVariables; |
21 unit uVariables; |
22 interface |
22 interface |
23 |
23 |
24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math; |
24 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils{$IFDEF GL2}, uMatrix{$ENDIF}; |
25 |
25 |
26 var |
26 var |
27 /////// init flags /////// |
27 /////// init flags /////// |
28 cMinScreenWidth : LongInt; |
28 cMinScreenWidth : LongInt; |
29 cMinScreenHeight : LongInt; |
29 cMinScreenHeight : LongInt; |
35 cScreenHeight : LongInt; |
35 cScreenHeight : LongInt; |
36 cNewScreenWidth : LongInt; |
36 cNewScreenWidth : LongInt; |
37 cNewScreenHeight : LongInt; |
37 cNewScreenHeight : LongInt; |
38 cScreenResizeDelay : LongWord; |
38 cScreenResizeDelay : LongWord; |
39 ipcPort : Word; |
39 ipcPort : Word; |
|
40 AprilOne : boolean; |
40 cFullScreen : boolean; |
41 cFullScreen : boolean; |
41 cLocaleFName : shortstring; |
42 cLocaleFName : shortstring; |
42 cLocale : shortstring; |
43 cLocale : shortstring; |
43 cTimerInterval : LongInt; |
44 cTimerInterval : LongInt; |
44 PathPrefix : shortstring; |
45 PathPrefix : ansistring; |
45 UserPathPrefix : shortstring; |
46 UserPathPrefix : ansistring; |
46 cShowFPS : boolean; |
47 cShowFPS : boolean; |
47 cFlattenFlakes : boolean; |
48 cFlattenFlakes : boolean; |
48 cFlattenClouds : boolean; |
49 cFlattenClouds : boolean; |
49 cIce : boolean; |
50 cIce : boolean; |
50 cSnow : boolean; |
51 cSnow : boolean; |
95 ReadyTimeLeft : Longword; |
96 ReadyTimeLeft : Longword; |
96 cSuddenDTurns : LongInt; |
97 cSuddenDTurns : LongInt; |
97 cDamagePercent : LongInt; |
98 cDamagePercent : LongInt; |
98 cMineDudPercent : LongWord; |
99 cMineDudPercent : LongWord; |
99 cTemplateFilter : LongInt; |
100 cTemplateFilter : LongInt; |
100 cMapGen : LongInt; |
101 cFeatureSize : LongInt; |
|
102 cMapGen : TMapGen; |
101 cRopePercent : LongWord; |
103 cRopePercent : LongWord; |
102 cGetAwayTime : LongWord; |
104 cGetAwayTime : LongWord; |
|
105 |
|
106 cAdvancedMapGenMode: boolean; |
103 |
107 |
104 cHedgehogTurnTime: Longword; |
108 cHedgehogTurnTime: Longword; |
105 cMinesTime : LongInt; |
109 cMinesTime : LongInt; |
106 cMaxAIThinkTime : Longword; |
110 cMaxAIThinkTime : Longword; |
107 |
111 |
133 LAND_WIDTH : LongInt; |
141 LAND_WIDTH : LongInt; |
134 LAND_HEIGHT : LongInt; |
142 LAND_HEIGHT : LongInt; |
135 LAND_WIDTH_MASK : LongWord; |
143 LAND_WIDTH_MASK : LongWord; |
136 LAND_HEIGHT_MASK : LongWord; |
144 LAND_HEIGHT_MASK : LongWord; |
137 |
145 |
|
146 ChefHatTexture : PTexture; |
138 CrosshairTexture : PTexture; |
147 CrosshairTexture : PTexture; |
139 GenericHealthTexture : PTexture; |
148 GenericHealthTexture : PTexture; |
140 |
149 |
141 cLeftScreenBorder : LongInt; |
150 cLeftScreenBorder : LongInt; |
142 cRightScreenBorder : LongInt; |
151 cRightScreenBorder : LongInt; |
143 cScreenSpace : Longword; |
152 cScreenSpace : Longword; |
144 |
153 |
145 cCaseFactor : Longword; |
154 cCaseFactor : Longword; |
146 cLandMines : Longword; |
155 cLandMines : Longword; |
|
156 cAirMines : Longword; |
147 cExplosives : Longword; |
157 cExplosives : Longword; |
148 |
158 |
149 cScriptName : shortstring; |
159 cScriptName : shortstring; |
|
160 cScriptParam : shortstring; |
150 cSeed : shortstring; |
161 cSeed : shortstring; |
151 cVolumeDelta : LongInt; |
162 cVolumeDelta : LongInt; |
152 cHasFocus : boolean; |
163 cHasFocus : boolean; |
153 cInactDelay : Longword; |
164 cInactDelay : Longword; |
154 |
165 |
157 |
168 |
158 CrosshairX : LongInt; |
169 CrosshairX : LongInt; |
159 CrosshairY : LongInt; |
170 CrosshairY : LongInt; |
160 CursorMovementX : LongInt; |
171 CursorMovementX : LongInt; |
161 CursorMovementY : LongInt; |
172 CursorMovementY : LongInt; |
|
173 cWaveHeight : LongInt; |
162 cDrownSpeed : hwFloat; |
174 cDrownSpeed : hwFloat; |
163 cDrownSpeedf : real; |
175 cDrownSpeedf : real; |
164 cMaxWindSpeed : hwFloat; |
176 cMaxWindSpeed : hwFloat; |
165 cWindSpeed : hwFloat; |
177 cWindSpeed : hwFloat; |
166 cWindSpeedf : real; |
178 cWindSpeedf : real; |
167 cElastic : hwFloat; |
179 cElastic : hwFloat; |
168 cGravity : hwFloat; |
180 cGravity : hwFloat; |
169 cGravityf : real; |
181 cGravityf : real; |
|
182 cBuildMaxDist : LongInt; |
170 cDamageModifier : hwFloat; |
183 cDamageModifier : hwFloat; |
171 cLaserSighting : boolean; |
184 cLaserSighting : boolean; |
172 cVampiric : boolean; |
185 cVampiric : boolean; |
173 cArtillery : boolean; |
186 cArtillery : boolean; |
174 WeaponTooltipTex: PTexture; |
187 WeaponTooltipTex: PTexture; |
175 AmmoMenuInvalidated: boolean; |
188 AmmoMenuInvalidated: boolean; |
176 AmmoRect : TSDL_Rect; |
189 AmmoRect : TSDL_Rect; |
177 HHTexture : PTexture; |
190 HHTexture : PTexture; |
178 cMaxZoomLevel : real; |
191 cMaxZoomLevel : real; |
179 cMinZoomLevel : real; |
192 cMinZoomLevel : real; |
180 cZoomDelta : real; |
193 cZoomDelta : real; |
181 cMinMaxZoomLevelDelta : real; |
194 cMinMaxZoomLevelDelta : real; |
182 |
195 |
183 |
196 |
184 flagMakeCapture : boolean; |
197 flagMakeCapture : boolean; |
|
198 flagDumpLand : boolean; |
185 |
199 |
186 InitStepsFlags : Longword; |
200 InitStepsFlags : Longword; |
187 RealTicks : Longword; |
201 RealTicks : Longword; |
188 AttackBar : LongInt; |
202 AttackBar : LongInt; |
189 |
203 |
190 WaterColorArray : array[0..3] of HwColor4f; |
204 WaterColorArray : array[0..7] of HwColor4f; |
191 SDWaterColorArray : array[0..3] of HwColor4f; |
205 SDWaterColorArray : array[0..7] of HwColor4f; |
192 SDTint : LongInt; |
206 SDTint : LongInt; |
193 |
207 |
194 TargetCursorPoint : TPoint; |
208 TargetCursorPoint : TPoint; |
195 CursorPoint : TPoint; |
209 CursorPoint : TPoint; |
196 TargetPoint : TPoint; |
210 TargetPoint : TPoint; |
206 disableLandBack : boolean; |
220 disableLandBack : boolean; |
207 |
221 |
208 WorldDx: LongInt; |
222 WorldDx: LongInt; |
209 WorldDy: LongInt; |
223 WorldDy: LongInt; |
210 |
224 |
|
225 SpeechHogNumber: LongInt; |
|
226 |
|
227 // for tracking the limits of the visible grid based on cScaleFactor |
|
228 ViewLeftX, ViewRightX, ViewBottomY, ViewTopY, ViewWidth, ViewHeight: LongInt; |
|
229 |
|
230 // for debugging the view limits visually |
|
231 cViewLimitsDebug: boolean; |
|
232 |
|
233 dirtyLandTexCount: LongInt; |
|
234 |
211 hiTicks: Word; |
235 hiTicks: Word; |
212 |
236 |
213 LuaGoals : shortstring; |
237 LuaGoals : shortstring; |
214 |
238 |
215 LuaTemplateNumber : LongWord; |
239 LuaTemplateNumber : LongWord; |
216 |
240 |
217 LastVoice : TVoice = ( snd: sndNone; voicepack: nil ); |
241 LastVoice : TVoice; |
218 |
242 |
219 mobileRecord: TMobileRecord; |
243 mobileRecord: TMobileRecord; |
|
244 |
|
245 MaxTextureSize: LongInt; |
|
246 |
|
247 ChatPasteBuffer: shortstring; |
220 |
248 |
221 ///////////////////////////////////// |
249 ///////////////////////////////////// |
222 //Buttons |
250 //Buttons |
223 {$IFDEF USE_TOUCH_INTERFACE} |
251 {$IFDEF USE_TOUCH_INTERFACE} |
224 buttonScale: GLFloat; |
252 buttonScale: GLFloat; |
251 '/Sounds/voices', // ptVoices |
282 '/Sounds/voices', // ptVoices |
252 '/Graphics/Hats', // ptHats |
283 '/Graphics/Hats', // ptHats |
253 '/Graphics/Flags', // ptFlags |
284 '/Graphics/Flags', // ptFlags |
254 '/Missions/Maps', // ptMissionMaps |
285 '/Missions/Maps', // ptMissionMaps |
255 '/Graphics/SuddenDeath', // ptSuddenDeath |
286 '/Graphics/SuddenDeath', // ptSuddenDeath |
256 '/Graphics/Buttons' // ptButton |
287 '/Graphics/Buttons', // ptButton |
|
288 '/Shaders' // ptShaders |
257 ); |
289 ); |
258 |
290 |
259 Fontz: array[THWFont] of THHFont = ( |
291 var |
|
292 Fontz: array[THWFont] of THHFont; |
|
293 |
|
294 const |
|
295 FontzInit: array[THWFont] of THHFont = ( |
260 (Handle: nil; |
296 (Handle: nil; |
261 Height: 12; |
297 Height: 12; |
262 style: TTF_STYLE_NORMAL; |
298 style: TTF_STYLE_NORMAL; |
263 Name: 'DejaVuSans-Bold.ttf'), |
299 Name: 'DejaVuSans-Bold.ttf'), |
264 (Handle: nil; |
300 (Handle: nil; |
284 Name: 'wqy-zenhei.ttc') |
320 Name: 'wqy-zenhei.ttc') |
285 {$ENDIF} |
321 {$ENDIF} |
286 ); |
322 ); |
287 |
323 |
288 var |
324 var |
289 SpritesData: array[TSprite] of record |
325 SpritesData: array[TSprite] of TSpriteData; |
290 FileName: string[15]; |
326 |
291 Path, AltPath: TPathType; |
327 const |
292 Texture: PTexture; |
328 SpritesDataInit: array[TSprite] of TSpriteData = ( |
293 Surface: PSDL_Surface; |
|
294 Width, Height, imageWidth, imageHeight: LongInt; |
|
295 saveSurf: boolean; |
|
296 priority: GLfloat; |
|
297 getDimensions, getImageDimensions: boolean; |
|
298 end = ( |
|
299 (FileName: 'BlueWater'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
329 (FileName: 'BlueWater'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
300 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprWater |
330 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprWater |
301 (FileName: 'Clouds'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
331 (FileName: 'Clouds'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
302 Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprCloud |
332 Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprCloud |
303 (FileName: 'Bomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
333 (FileName: 'Bomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
343 (FileName: 'Flame'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
373 (FileName: 'Flame'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
344 Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprFlame |
374 Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprFlame |
345 (FileName: 'horizont'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
375 (FileName: 'horizont'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
346 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizont |
376 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizont |
347 (FileName: 'horizontL'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
377 (FileName: 'horizontL'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
348 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizont |
378 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizontL |
349 (FileName: 'horizontR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
379 (FileName: 'horizontR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
350 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizont |
380 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprHorizontR |
351 (FileName: 'Sky'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
381 (FileName: 'Sky'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
352 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky |
382 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky |
353 (FileName: 'SkyL'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
383 (FileName: 'SkyL'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
354 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky |
384 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSkyL |
355 (FileName: 'SkyR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
385 (FileName: 'SkyR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil; |
356 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky |
386 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSkyR |
357 (FileName: 'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
387 (FileName: 'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
358 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot |
388 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot |
359 (FileName: 'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
389 (FileName: 'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
360 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMAmmos |
390 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMAmmos |
361 (FileName: 'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
391 (FileName: 'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil; |
395 (FileName: 'WindR'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
425 (FileName: 'WindR'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
396 Width: 80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindR |
426 Width: 80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindR |
397 {$IFDEF USE_TOUCH_INTERFACE} |
427 {$IFDEF USE_TOUCH_INTERFACE} |
398 (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
428 (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
399 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton |
429 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton |
400 (FileName: 'arrowUp'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
430 (FileName: 'arrowup'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
401 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowUp |
431 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowUp |
402 (FileName: 'arrowDown'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
432 (FileName: 'arrowdown'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
403 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowDown |
433 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowDown |
404 (FileName: 'arrowLeft'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
434 (FileName: 'arrowleft'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
405 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowLeft |
435 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowLeft |
406 (FileName: 'arrowRight'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
436 (FileName: 'arrowright'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
407 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowRight |
437 Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowRight |
408 (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
438 (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
409 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprAMWidget |
439 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprAMWidget |
410 (FileName: 'backjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
440 (FileName: 'backjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
411 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprJumpWidget |
441 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprJumpWidget |
412 (FileName: 'pause'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
442 (FileName: 'pause'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
413 Width: 120; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprPauseButton |
443 Width: 120; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprPauseButton |
414 (FileName: 'pause'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;//TODO correct image |
444 (FileName: 'timerbutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
415 Width: 120; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTimerButton |
445 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTimerButton |
416 (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;//TODO correct image |
446 (FileName: 'targetbutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
417 Width: 120; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTargetButton |
447 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTargetButton |
|
448 (FileName: 'switchbutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil; |
|
449 Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprSwitchButton |
418 {$ENDIF} |
450 {$ENDIF} |
419 (FileName: 'Flake'; Path:ptCurrTheme; AltPath: ptNone; Texture: nil; Surface: nil; |
451 (FileName: 'Flake'; Path:ptCurrTheme; AltPath: ptNone; Texture: nil; Surface: nil; |
420 Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprFlake |
452 Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprFlake |
421 (FileName: 'amRope'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
453 (FileName: 'amRope'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
422 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandRope |
454 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandRope |
663 Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprSDCloud |
695 Width: 256; Height:128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprSDCloud |
664 (FileName: 'SDSplash'; Path: ptCurrTheme; AltPath: ptSuddenDeath; Texture: nil; Surface: nil; |
696 (FileName: 'SDSplash'; Path: ptCurrTheme; AltPath: ptSuddenDeath; Texture: nil; Surface: nil; |
665 Width: 80; Height: 50; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprSDSplash |
697 Width: 80; Height: 50; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprSDSplash |
666 (FileName: 'SDDroplet'; Path: ptCurrTheme; AltPath: ptSuddenDeath; Texture: nil; Surface: nil; |
698 (FileName: 'SDDroplet'; Path: ptCurrTheme; AltPath: ptSuddenDeath; Texture: nil; Surface: nil; |
667 Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSDDroplet |
699 Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSDDroplet |
668 (FileName: 'TARDIS'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
700 (FileName: 'Timebox'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
669 Width: 48; Height: 79; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprTardis |
701 Width: 50; Height: 81; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprTardis |
670 (FileName: 'slider'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
702 (FileName: 'slider'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
671 Width: 3; Height: 17; imageWidth: 3; imageHeight: 17; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprSlider |
703 Width: 3; Height: 17; imageWidth: 3; imageHeight: 17; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprSlider |
672 (FileName: 'botlevels'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
704 (FileName: 'botlevels'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
673 Width: 22; Height: 15; imageWidth: 22; imageHeight: 15; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprBotlevels |
705 Width: 22; Height: 15; imageWidth: 22; imageHeight: 15; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprBotlevels |
674 (FileName: 'amCleaver'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
706 (FileName: 'amCleaver'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
684 (FileName: 'amFrozenHog'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
716 (FileName: 'amFrozenHog'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
685 Width: 64; Height: 64; imageWidth: 64; imageHeight: 64; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprFrozenHog |
717 Width: 64; Height: 64; imageWidth: 64; imageHeight: 64; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprFrozenHog |
686 (FileName: 'amRubber'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil; |
718 (FileName: 'amRubber'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil; |
687 Width: 160; Height:160; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprAmRubber |
719 Width: 160; Height:160; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprAmRubber |
688 (FileName: 'boing'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
720 (FileName: 'boing'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
689 Width: 101; Height: 97; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprBoing |
721 Width: 101; Height: 97; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprBoing |
|
722 (FileName: 'custom1'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
|
723 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: true; getImageDimensions: true), // sprCustom1 |
|
724 (FileName: 'custom2'; Path: ptCurrTheme;AltPath: ptGraphics; Texture: nil; Surface: nil; |
|
725 Width: 0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: true; getImageDimensions: true), // sprCustom2 |
|
726 (FileName: 'AirMine'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; |
|
727 Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true), // sprAirMine |
|
728 (FileName: 'amAirMine'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; |
|
729 Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprHandAirMine |
690 ); |
730 ); |
691 |
731 |
692 const |
732 const |
693 Wavez: array [TWave] of record |
733 Wavez: array [TWave] of record |
694 Sprite: TSprite; |
734 Sprite: TSprite; |
705 (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0), |
745 (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0), |
706 (Sprite: sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0), |
746 (Sprite: sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0), |
707 (Sprite: sprJuggle; FramesCount: 49; Interval: 38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0) |
747 (Sprite: sprJuggle; FramesCount: 49; Interval: 38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0) |
708 ); |
748 ); |
709 |
749 |
710 var |
750 type |
711 Ammoz: array [TAmmoType] of record |
751 TAmmozRec = record |
712 NameId: TAmmoStrId; |
752 NameId: TAmmoStrId; |
713 NameTex: PTexture; |
753 NameTex: PTexture; |
714 Probability, NumberInCase: Longword; |
754 Probability, NumberInCase: Longword; |
715 Ammo: TAmmo; |
755 Ammo: TAmmo; |
716 Slot: 0..cMaxSlotIndex; |
756 Slot: 0..cMaxSlotIndex; |
717 TimeAfterTurn: Longword; |
757 TimeAfterTurn: Longword; |
718 minAngle, maxAngle: Longword; |
758 minAngle, maxAngle: Longword; |
719 isDamaging: boolean; |
759 isDamaging: boolean; |
720 SkipTurns: Longword; |
760 SkipTurns: LongWord; |
721 PosCount: Longword; |
761 PosCount: Longword; |
722 PosSprite: TSprite; |
762 PosSprite: TSprite; |
723 ejectX, ejectY: Longint; |
763 ejectX, ejectY: Longint; |
724 end = ( |
764 end; |
|
765 |
|
766 var |
|
767 Ammoz: array [TAmmoType] of TAmmozRec; |
|
768 |
|
769 const |
|
770 AmmozInit: array [TAmmoType] of TAmmozRec = ( |
725 (NameId: sidNothing; |
771 (NameId: sidNothing; |
726 NameTex: nil; |
772 NameTex: nil; |
727 Probability: 0; |
773 Probability: 0; |
728 NumberInCase: 0; |
774 NumberInCase: 0; |
729 Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_DontHold or ammoprop_Effect; |
775 Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_DontHold or ammoprop_Effect; |
2361 |
2436 |
2362 DefaultBinds : TBinds; |
2437 DefaultBinds : TBinds; |
2363 |
2438 |
2364 lastTurnChecksum : Longword; |
2439 lastTurnChecksum : Longword; |
2365 |
2440 |
|
2441 mModelview: TMatrix4x4f; |
|
2442 mProjection: TMatrix4x4f; |
|
2443 vBuffer: GLuint; // vertex buffer |
|
2444 tBuffer: GLuint; // texture coords buffer |
|
2445 cBuffer: GLuint; // color buffer |
|
2446 |
|
2447 uCurrentMVPLocation: GLint; |
|
2448 |
|
2449 uMainMVPLocation: GLint; |
|
2450 uMainTintLocation: GLint; |
|
2451 |
|
2452 uWaterMVPLocation: GLint; |
|
2453 |
|
2454 aVertex: GLint; |
|
2455 aTexCoord: GLint; |
|
2456 aColor: GLint; |
|
2457 |
2366 var trammo: array[TAmmoStrId] of ansistring; // name of the weapon |
2458 var trammo: array[TAmmoStrId] of ansistring; // name of the weapon |
2367 trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon |
2459 trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon |
2368 trammod: array[TAmmoStrId] of ansistring; // description of the weapon |
2460 trammod: array[TAmmoStrId] of ansistring; // description of the weapon |
2369 trmsg: array[TMsgStrId] of ansistring; // message of the event |
2461 trmsg: array[TMsgStrId] of ansistring; // message of the event |
2370 trgoal: array[TGoalStrId] of ansistring; // message of the goal |
2462 trgoal: array[TGoalStrId] of ansistring; // message of the goal |
|
2463 cTestLua : Boolean; |
2371 |
2464 |
2372 procedure preInitModule; |
2465 procedure preInitModule; |
2373 procedure initModule; |
2466 procedure initModule; |
2374 procedure freeModule; |
2467 procedure freeModule; |
2375 |
2468 |
2376 implementation |
2469 implementation |
2377 uses strutils; |
|
2378 |
2470 |
2379 procedure preInitModule; |
2471 procedure preInitModule; |
2380 begin |
2472 begin |
2381 // initialisation flags - they are going to be overwritten by program args |
2473 // initialisation flags - they are going to be overwritten by program args |
2382 |
2474 |
2401 cStereoMode := smNone; |
2493 cStereoMode := smNone; |
2402 GrayScale := false; |
2494 GrayScale := false; |
2403 PathPrefix := './'; |
2495 PathPrefix := './'; |
2404 GameType := gmtLocal; |
2496 GameType := gmtLocal; |
2405 cOnlyStats := False; |
2497 cOnlyStats := False; |
|
2498 cScriptName := ''; |
|
2499 cScriptParam := ''; |
|
2500 cTestLua := False; |
2406 |
2501 |
2407 {$IFDEF USE_VIDEO_RECORDING} |
2502 {$IFDEF USE_VIDEO_RECORDING} |
2408 RecPrefix := ''; |
2503 RecPrefix := ''; |
2409 cAVFormat := ''; |
2504 cAVFormat := ''; |
2410 cVideoCodec := ''; |
2505 cVideoCodec := ''; |
2411 cVideoFramerateNum := 0; |
2506 cVideoFramerateNum := 0; |
2412 cVideoFramerateDen := 0; |
2507 cVideoFramerateDen := 0; |
2413 cVideoQuality := 0; |
2508 cVideoQuality := 0; |
2414 cAudioCodec := ''; |
2509 cAudioCodec := ''; |
2415 {$ENDIF} |
2510 {$ENDIF} |
|
2511 |
|
2512 cTagsMask:= htTeamName or htName or htHealth; |
2416 end; |
2513 end; |
2417 |
2514 |
2418 procedure initModule; |
2515 procedure initModule; |
|
2516 var s: shortstring; |
|
2517 i: integer; |
2419 begin |
2518 begin |
2420 // TODO: we could just have one cLocale variables and drop strutils |
2519 // init LastVoice |
2421 cLocale:= ExtractDelimited(1, cLocaleFName, StdWordDelims); |
2520 LastVoice.snd:= sndNone; |
|
2521 LastVoice.voicepack:= nil; |
|
2522 |
|
2523 // init arrays |
|
2524 Move(cPathzInit, cPathz, sizeof(cPathz)); |
|
2525 Move(FontzInit, Fontz, sizeof(Fontz)); |
|
2526 Move(SpritesDataInit, SpritesData, sizeof(SpritesData)); |
|
2527 Move(AmmozInit, Ammoz, sizeof(Ammoz)); |
|
2528 |
|
2529 |
|
2530 cLocale:= cLocaleFName; |
|
2531 SplitByChar(cLocale, s, '.'); |
2422 |
2532 |
2423 cFlattenFlakes := false; |
2533 cFlattenFlakes := false; |
2424 cFlattenClouds := false; |
2534 cFlattenClouds := false; |
2425 cIce := false; |
2535 cIce := false; |
2426 cSnow := false; |
2536 cSnow := false; |
2446 LAND_HEIGHT:= 2048; |
2556 LAND_HEIGHT:= 2048; |
2447 LAND_WIDTH_MASK:= $FFFFF000; |
2557 LAND_WIDTH_MASK:= $FFFFF000; |
2448 LAND_HEIGHT_MASK:= $FFFFF800 |
2558 LAND_HEIGHT_MASK:= $FFFFF800 |
2449 end; |
2559 end; |
2450 |
2560 |
2451 SDWaterColorArray[0].r := 182; |
2561 // default sudden death water |
2452 SDWaterColorArray[0].g := 144; |
2562 |
2453 SDWaterColorArray[0].b := 201; |
2563 // deep water |
|
2564 SDWaterColorArray[0].r := 150; |
|
2565 SDWaterColorArray[0].g := 112; |
|
2566 SDWaterColorArray[0].b := 169; |
2454 SDWaterColorArray[0].a := 255; |
2567 SDWaterColorArray[0].a := 255; |
2455 SDWaterColorArray[2].r := 150; |
2568 SDWaterColorArray[2]:= SDWaterColorArray[0]; |
2456 SDWaterColorArray[2].g := 112; |
2569 SDWaterColorArray[4]:= SDWaterColorArray[0]; |
2457 SDWaterColorArray[2].b := 169; |
2570 SDWaterColorArray[6]:= SDWaterColorArray[0]; |
2458 SDWaterColorArray[2].a := 255; |
2571 // water surface |
2459 SDWaterColorArray[1]:= SDWaterColorArray[0]; |
2572 SDWaterColorArray[1].r := 182; |
2460 SDWaterColorArray[3]:= SDWaterColorArray[2]; |
2573 SDWaterColorArray[1].g := 144; |
|
2574 SDWaterColorArray[1].b := 201; |
|
2575 SDWaterColorArray[1].a := 255; |
|
2576 SDWaterColorArray[3]:= SDWaterColorArray[1]; |
|
2577 SDWaterColorArray[5]:= SDWaterColorArray[1]; |
|
2578 SDWaterColorArray[7]:= SDWaterColorArray[1]; |
|
2579 |
2461 SDWaterOpacity:= $80; |
2580 SDWaterOpacity:= $80; |
|
2581 |
2462 SDTint:= $80; |
2582 SDTint:= $80; |
|
2583 ExplosionBorderColorR:= 80; |
|
2584 ExplosionBorderColorG:= 80; |
|
2585 ExplosionBorderColorB:= 80; |
2463 ExplosionBorderColor:= $FF808080; |
2586 ExplosionBorderColor:= $FF808080; |
|
2587 ExplosionBorderColorNoA:= ExplosionBorderColor and (not AMask); |
2464 IceColor:= ($44 shl RShift) or ($97 shl GShift) or ($A9 shl BShift) or ($A0 shl AShift); |
2588 IceColor:= ($44 shl RShift) or ($97 shl GShift) or ($A9 shl BShift) or ($A0 shl AShift); |
2465 IceEdgeColor:= ($8A shl RShift) or ($AF shl GShift) or ($B2 shl BShift) or ($FF shl AShift); |
2589 IceEdgeColor:= ($8A shl RShift) or ($AF shl GShift) or ($B2 shl BShift) or ($FF shl AShift); |
2466 |
2590 |
2467 WaterOpacity:= $80; |
2591 WaterOpacity:= $80; |
2468 |
2592 |
|
2593 cWaveHeight := 32; |
2469 cDrownSpeed.QWordValue := 257698038; // 0.06 |
2594 cDrownSpeed.QWordValue := 257698038; // 0.06 |
2470 cDrownSpeedf := 0.06; |
2595 cDrownSpeedf := 0.06; |
2471 cMaxWindSpeed.QWordValue:= 1073742; // 0.00025 |
2596 cMaxWindSpeed.QWordValue:= 1073742; // 0.00025 |
2472 cWindSpeed.QWordValue := 0; // 0.0 |
2597 cWindSpeed.QWordValue := 0; // 0.0 |
2473 cWindSpeedf := 0.0; |
2598 cWindSpeedf := 0.0; |
2474 cElastic := _0_9; |
2599 cElastic := _0_9; |
2475 cGravity := cMaxWindSpeed * 2; |
2600 cGravity := cMaxWindSpeed * 2; |
2476 cGravityf := 0.00025 * 2; |
2601 cGravityf := 0.00025 * 2; |
|
2602 cBuildMaxDist := cDefaultBuildMaxDist; |
2477 cDamageModifier := _1; |
2603 cDamageModifier := _1; |
2478 TargetPoint := cTargetPointRef; |
2604 TargetPoint := cTargetPointRef; |
2479 |
2605 |
2480 {$IFDEF MOBILE} |
2606 {$IFDEF MOBILE} |
2481 cMaxZoomLevel:= 0.5; |
2607 cMaxZoomLevel:= 0.5; |
2509 cDamagePercent := 100; |
2635 cDamagePercent := 100; |
2510 cRopePercent := 100; |
2636 cRopePercent := 100; |
2511 cGetAwayTime := 100; |
2637 cGetAwayTime := 100; |
2512 cMineDudPercent := 0; |
2638 cMineDudPercent := 0; |
2513 cTemplateFilter := 0; |
2639 cTemplateFilter := 0; |
2514 cMapGen := 0; // MAPGEN_REGULAR |
2640 cFeatureSize := 50; |
|
2641 cMapGen := mgRandom; |
2515 cHedgehogTurnTime := 45000; |
2642 cHedgehogTurnTime := 45000; |
2516 cMinesTime := 3000; |
2643 cMinesTime := 3000; |
2517 cMaxAIThinkTime := 9000; |
2644 cMaxAIThinkTime := 9000; |
2518 cCloudsNumber := 9; |
2645 cCloudsNumber := 9; |
2519 cSDCloudsNumber := 9; |
2646 cSDCloudsNumber := 9; |
2520 cHealthCaseProb := 35; |
2647 cHealthCaseProb := 35; |
2521 cHealthCaseAmount := 25; |
2648 cHealthCaseAmount := 25; |
2522 cWaterRise := 47; |
2649 cWaterRise := 47; |
2523 cHealthDecrease := 5; |
2650 cHealthDecrease := 5; |
|
2651 cAdvancedMapGenMode := false; |
2524 |
2652 |
2525 InitStepsFlags := 0; |
2653 InitStepsFlags := 0; |
2526 RealTicks := 0; |
2654 RealTicks := 0; |
2527 AttackBar := 0; // 0 - none, 1 - just bar at the right-down corner, 2 - from weapon |
2655 AttackBar := 0; // 0 - none, 1 - just bar at the right-down corner, 2 - from weapon |
2528 cCaseFactor := 5; {0..9} |
2656 cCaseFactor := 5; {0..9} |
2529 cLandMines := 4; |
2657 cLandMines := 4; |
|
2658 cAirMines := 0; |
2530 cExplosives := 2; |
2659 cExplosives := 2; |
2531 |
2660 |
2532 GameState := Low(TGameState); |
2661 GameState := Low(TGameState); |
2533 zoom := cDefaultZoomLevel; |
2662 zoom := cDefaultZoomLevel; |
2534 ZoomValue := cDefaultZoomLevel; |
2663 ZoomValue := cDefaultZoomLevel; |
2535 WeaponTooltipTex:= nil; |
2664 WeaponTooltipTex:= nil; |
2536 cLaserSighting := false; |
2665 cLaserSighting := false; |
2537 cVampiric := false; |
2666 cVampiric := false; |
2538 cArtillery := false; |
2667 cArtillery := false; |
2539 flagMakeCapture := false; |
2668 flagMakeCapture := false; |
|
2669 flagDumpLand := false; |
2540 bBetweenTurns := false; |
2670 bBetweenTurns := false; |
2541 bWaterRising := false; |
2671 bWaterRising := false; |
2542 isCursorVisible := false; |
2672 isCursorVisible := false; |
2543 isInLag := false; |
2673 isInLag := false; |
2544 isPaused := false; |
2674 isPaused := false; |
2547 isAFK := false; |
2677 isAFK := false; |
2548 SpeedStart := 0; |
2678 SpeedStart := 0; |
2549 fastUntilLag := false; |
2679 fastUntilLag := false; |
2550 fastScrolling := false; |
2680 fastScrolling := false; |
2551 autoCameraOn := true; |
2681 autoCameraOn := true; |
2552 cScriptName := ''; |
|
2553 cSeed := ''; |
2682 cSeed := ''; |
2554 cVolumeDelta := 0; |
2683 cVolumeDelta := 0; |
2555 cHasFocus := true; |
2684 cHasFocus := true; |
2556 cInactDelay := 100; |
2685 cInactDelay := 100; |
2557 ReadyTimeLeft := 0; |
2686 ReadyTimeLeft := 0; |
2558 |
2687 |
2559 disableLandBack := false; |
2688 disableLandBack := false; |
2560 ScreenFade := sfNone; |
2689 ScreenFade := sfNone; |
2561 |
2690 |
2562 // those values still are not perfect |
2691 // those values still are not perfect |
2563 cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth); |
2692 cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth); |
2564 cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH); |
2693 cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH); |
2565 cScreenSpace:= cRightScreenBorder - cLeftScreenBorder; |
2694 cScreenSpace:= cRightScreenBorder - cLeftScreenBorder; |
2566 |
2695 |
2567 vobFrameTicks:= 99999; |
2696 dirtyLandTexCount:= 0; |
|
2697 |
|
2698 vobFrameTicks:= 0; |
2568 vobFramesCount:= 4; |
2699 vobFramesCount:= 4; |
2569 vobCount:= 0; |
2700 vobCount:= 0; |
2570 vobVelocity:= 10; |
2701 vobVelocity:= 10; |
2571 vobFallSpeed:= 100; |
2702 vobFallSpeed:= 100; |
2572 |
2703 |
2573 vobSDFrameTicks:= 99999; |
2704 vobSDFrameTicks:= 0; |
2574 vobSDFramesCount:= 4; |
2705 vobSDFramesCount:= 4; |
2575 vobSDCount:= 30 * cScreenSpace div LAND_WIDTH; |
2706 vobSDCount:= 30 * cScreenSpace div LAND_WIDTH; |
2576 vobSDVelocity:= 15; |
2707 vobSDVelocity:= 15; |
2577 vobSDFallSpeed:= 250; |
2708 vobSDFallSpeed:= 250; |
2578 |
2709 |
|
2710 {$IFDEF MOBILE} |
|
2711 cMinScreenWidth := min(cScreenWidth, 480); |
|
2712 cMinScreenHeight := min(cScreenHeight, 320); |
|
2713 {$ELSE} |
2579 cMinScreenWidth := min(cScreenWidth, 640); |
2714 cMinScreenWidth := min(cScreenWidth, 640); |
2580 cMinScreenHeight := min(cScreenHeight, 480); |
2715 cMinScreenHeight := min(cScreenHeight, 480); |
|
2716 {$ENDIF} |
2581 |
2717 |
2582 cNewScreenWidth := cScreenWidth; |
2718 cNewScreenWidth := cScreenWidth; |
2583 cNewScreenHeight := cScreenHeight; |
2719 cNewScreenHeight := cScreenHeight; |
2584 cScreenResizeDelay := 0; |
2720 cScreenResizeDelay := 0; |
2585 |
2721 |
2587 if cFullscreenWidth = 0 then |
2723 if cFullscreenWidth = 0 then |
2588 cFullscreenWidth:= min(cWindowedWidth, 640); |
2724 cFullscreenWidth:= min(cWindowedWidth, 640); |
2589 if cFullscreenHeight = 0 then |
2725 if cFullscreenHeight = 0 then |
2590 cFullscreenHeight:= min(cWindowedHeight, 480); |
2726 cFullscreenHeight:= min(cWindowedHeight, 480); |
2591 |
2727 |
|
2728 SpeechHogNumber:= -1; |
2592 |
2729 |
2593 LuaGoals:= ''; |
2730 LuaGoals:= ''; |
2594 cMapName:= ''; |
2731 cMapName:= ''; |
2595 |
2732 |
2596 LuaTemplateNumber:= 0; |
2733 LuaTemplateNumber:= 0; |
2597 |
2734 |
2598 UIDisplay:= uiAll; |
2735 UIDisplay:= uiAll; |
2599 LocalMessage:= 0; |
2736 LocalMessage:= 0; |
|
2737 |
|
2738 cStereoDepth:= 0; |
|
2739 cViewLimitsDebug:= false; |
|
2740 AprilOne := false; |
|
2741 |
|
2742 ChatPasteBuffer:= ''; |
|
2743 |
|
2744 // initialize pointers to nil |
|
2745 // (don't rely on implicit init of fpc, because that one only happens ONCE when used as lib) |
|
2746 CurAmmoGear:= nil; |
|
2747 lastGearByUID:= nil; |
|
2748 GearsList:= nil; |
|
2749 CurrentTeam:= nil; |
|
2750 PreviousTeam:= nil; |
|
2751 CurrentHedgehog:= nil; |
|
2752 FollowGear:= nil; |
|
2753 lastVisualGearByUID:= nil; |
|
2754 |
|
2755 ChefHatTexture:= nil; |
|
2756 CrosshairTexture:= nil; |
|
2757 GenericHealthTexture:= nil; |
|
2758 WeaponTooltipTex:= nil; |
|
2759 HHTexture:= nil; |
|
2760 LandBackSurface:= nil; |
|
2761 ConfirmTexture:= nil; |
|
2762 MissionIcons:= nil; |
|
2763 ropeIconTex:= nil; |
|
2764 |
|
2765 for i:= Low(ClansArray) to High(ClansArray) do |
|
2766 begin |
|
2767 ClansArray[i]:= nil; |
|
2768 end; |
|
2769 |
|
2770 for i:= Low(TeamsArray) to High(TeamsArray) do |
|
2771 begin |
|
2772 TeamsArray[i]:= nil; |
|
2773 end; |
|
2774 |
|
2775 for i:= Low(CountTexz) to High(CountTexz) do |
|
2776 begin |
|
2777 CountTexz[i]:= nil; |
|
2778 end; |
|
2779 |
2600 end; |
2780 end; |
2601 |
2781 |
2602 procedure freeModule; |
2782 procedure freeModule; |
2603 begin |
2783 begin |
2604 end; |
2784 end; |