author | unc0rr |
Thu, 07 Aug 2008 12:01:58 +0000 | |
changeset 1159 | 49c88f620e51 |
parent 1128 | 9b3f42bf4eef |
child 1180 | e56317fdf78d |
permissions | -rw-r--r-- |
4 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
883 | 3 |
* Copyright (c) 2004-2008 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 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 |
|
4 | 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. |
|
4 | 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 |
|
4 | 17 |
*) |
18 |
||
19 |
unit uMisc; |
|
20 |
interface |
|
753 | 21 |
uses uConsts, SDLh, uFloat, GL; |
4 | 22 |
{$INCLUDE options.inc} |
1054 | 23 |
var |
24 |
isCursorVisible : boolean = false; |
|
25 |
isTerminated : boolean = false; |
|
26 |
isInLag : boolean = false; |
|
27 |
isPaused : boolean = false; |
|
28 |
isSoundEnabled : boolean = true; |
|
1128 | 29 |
isMusicEnabled : boolean = false; |
1054 | 30 |
isSEBackup : boolean = true; |
31 |
isInMultiShoot : boolean = false; |
|
32 |
isSpeed : boolean = false; |
|
4 | 33 |
|
1054 | 34 |
GameState : TGameState = Low(TGameState); |
35 |
GameType : TGameType = gmtLocal; |
|
36 |
GameFlags : Longword = 0; |
|
37 |
TurnTimeLeft : Longword = 0; |
|
38 |
cHedgehogTurnTime: Longword = 45000; |
|
39 |
cMaxAIThinkTime : Longword = 9000; |
|
4 | 40 |
|
1054 | 41 |
cCloudsNumber : LongInt = 9; |
42 |
cScreenWidth : LongInt = 1024; |
|
43 |
cScreenHeight : LongInt = 768; |
|
1121
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1080
diff
changeset
|
44 |
cInitWidth : LongInt = 1024; |
d595dc56b4f3
Remember initial resolution settings to use when switching to fullscreen mode
unc0rr
parents:
1080
diff
changeset
|
45 |
cInitHeight : LongInt = 768; |
1054 | 46 |
cBits : LongInt = 16; |
47 |
cBitsStr : string[2] = '16'; |
|
48 |
cTagsMask : byte = 7; |
|
74 | 49 |
|
1054 | 50 |
cWaterLine : LongInt = 1024; |
51 |
cVisibleWater : LongInt = 128; |
|
52 |
cGearScrEdgesDist: LongInt = 240; |
|
53 |
cCursorEdgesDist : LongInt = 40; |
|
54 |
cTeamHealthWidth : LongInt = 128; |
|
55 |
cAltDamage : boolean = true; |
|
4 | 56 |
|
1054 | 57 |
GameTicks : LongWord = 0; |
58 |
||
59 |
cSkyColor : Longword = 0; |
|
60 |
cWhiteColor : Longword = $FFFFFFFF; |
|
61 |
cColorNearBlack : Longword = $FF000010; |
|
62 |
cExplosionBorderColor : LongWord = $808080; |
|
4 | 63 |
|
1054 | 64 |
cShowFPS : boolean = true; |
65 |
cCaseFactor : Longword = 5; {0..9} |
|
66 |
cLandAdditions: Longword = 4; |
|
67 |
cFullScreen : boolean = true; |
|
68 |
cLocaleFName : shortstring = 'en.txt'; |
|
69 |
cSeed : shortstring = ''; |
|
70 |
cInitVolume : LongInt = 128; |
|
71 |
cVolumeDelta : LongInt = 0; |
|
72 |
cTimerInterval : Longword = 5; |
|
73 |
cHasFocus : boolean = true; |
|
1057 | 74 |
cInactDelay : Longword = 1250; |
4 | 75 |
|
1054 | 76 |
bBetweenTurns: boolean = false; |
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
77 |
cHealthDecrease: LongWord = 0; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
78 |
bWaterRising : Boolean = false; |
4 | 79 |
|
614 | 80 |
{$WARNINGS OFF} |
1124 | 81 |
cAirPlaneSpeed: hwFloat = (isNegative: false; QWordValue: 3006477107); // 1.4 |
1054 | 82 |
cBombsSpeed : hwFloat = (isNegative: false; QWordValue: 429496729); |
614 | 83 |
{$WARNINGS ON} |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
539
diff
changeset
|
84 |
|
4 | 85 |
var |
1054 | 86 |
cSendEmptyPacketTime : LongWord = 2000; |
87 |
cSendCursorPosTime : LongWord = 50; |
|
88 |
ShowCrosshair : boolean; |
|
89 |
cDrownSpeed, |
|
90 |
cMaxWindSpeed, |
|
91 |
cWindSpeed, |
|
92 |
cGravity: hwFloat; |
|
4 | 93 |
|
1054 | 94 |
flagMakeCapture: boolean = false; |
4 | 95 |
|
1054 | 96 |
InitStepsFlags: Longword = 0; |
55
e09f7c952a40
Send run parameters by cmd line, game parameters by IPC... breaks network game
unc0rr
parents:
53
diff
changeset
|
97 |
|
1054 | 98 |
RealTicks: Longword = 0; |
836 | 99 |
|
1054 | 100 |
AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP |
4 | 101 |
|
371 | 102 |
function hwSign(r: hwFloat): LongInt; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
788
diff
changeset
|
103 |
function Min(a, b: LongInt): LongInt; |
371 | 104 |
function Max(a, b: LongInt): LongInt; |
351 | 105 |
procedure OutError(Msg: String; isFatalError: boolean); |
4 | 106 |
procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean); |
107 |
procedure SDLTry(Assert: boolean; isFatal: boolean); |
|
316 | 108 |
function IntToStr(n: LongInt): shortstring; |
351 | 109 |
function FloatToStr(n: hwFloat): shortstring; |
775 | 110 |
function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; |
371 | 111 |
function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt; |
112 |
function DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt; |
|
4 | 113 |
procedure AdjustColor(var Color: Longword); |
114 |
{$IFDEF DEBUGFILE} |
|
115 |
procedure AddFileLog(s: shortstring); |
|
24 | 116 |
function RectToStr(Rect: TSDL_Rect): shortstring; |
4 | 117 |
{$ENDIF} |
208 | 118 |
procedure SetKB(n: Longword); |
119 |
procedure SendKB; |
|
351 | 120 |
procedure SetLittle(var r: hwFloat); |
306 | 121 |
procedure SendStat(sit: TStatInfoType; s: shortstring); |
753 | 122 |
function Str2PChar(const s: shortstring): PChar; |
755 | 123 |
function Surface2Tex(surf: PSDL_Surface): PTexture; |
759 | 124 |
procedure FreeTexture(tex: PTexture); |
945
4ead9cde4e14
- Start chat implementation: chat strings are on the screen
unc0rr
parents:
916
diff
changeset
|
125 |
function toPowerOf2(i: Longword): Longword; |
949 | 126 |
function DecodeBase64(s: shortstring): shortstring; |
1080 | 127 |
procedure MakeScreenshot(s: shortstring); |
4 | 128 |
|
129 |
var CursorPoint: TPoint; |
|
130 |
TargetPoint: TPoint = (X: NoPointX; Y: 0); |
|
131 |
||
132 |
implementation |
|
771 | 133 |
uses uConsole, uStore, uIO, Math, uRandom, GLU; |
208 | 134 |
var KBnum: Longword = 0; |
4 | 135 |
{$IFDEF DEBUGFILE} |
136 |
var f: textfile; |
|
137 |
{$ENDIF} |
|
138 |
||
371 | 139 |
function hwSign(r: hwFloat): LongInt; |
4 | 140 |
begin |
351 | 141 |
if r.isNegative then hwSign:= -1 else hwSign:= 1 |
4 | 142 |
end; |
143 |
||
371 | 144 |
function Min(a, b: LongInt): LongInt; |
4 | 145 |
begin |
351 | 146 |
if a < b then Min:= a else Min:= b |
4 | 147 |
end; |
148 |
||
371 | 149 |
function Max(a, b: LongInt): LongInt; |
4 | 150 |
begin |
351 | 151 |
if a > b then Max:= a else Max:= b |
4 | 152 |
end; |
153 |
||
351 | 154 |
procedure OutError(Msg: String; isFatalError: boolean); |
4 | 155 |
begin |
156 |
{$IFDEF DEBUGFILE}AddFileLog(Msg);{$ENDIF} |
|
53 | 157 |
WriteLnToConsole(Msg); |
4 | 158 |
if isFatalError then |
159 |
begin |
|
53 | 160 |
SendIPC('E' + GetLastConsoleLine); |
4 | 161 |
SDL_Quit; |
162 |
halt(1) |
|
53 | 163 |
end |
4 | 164 |
end; |
165 |
||
166 |
procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean); |
|
167 |
begin |
|
70 | 168 |
if not Assert then OutError(Msg, isFatal) |
4 | 169 |
end; |
170 |
||
171 |
procedure SDLTry(Assert: boolean; isFatal: boolean); |
|
172 |
begin |
|
173 |
if not Assert then OutError(SDL_GetError, isFatal) |
|
174 |
end; |
|
175 |
||
188 | 176 |
procedure AdjustColor(var Color: Longword); |
4 | 177 |
begin |
178 |
Color:= SDL_MapRGB(PixelFormat, (Color shr 16) and $FF, (Color shr 8) and $FF, Color and $FF) |
|
179 |
end; |
|
180 |
||
316 | 181 |
function IntToStr(n: LongInt): shortstring; |
4 | 182 |
begin |
351 | 183 |
str(n, IntToStr) |
4 | 184 |
end; |
185 |
||
351 | 186 |
function FloatToStr(n: hwFloat): shortstring; |
4 | 187 |
begin |
351 | 188 |
FloatToStr:= cstr(n) |
4 | 189 |
end; |
190 |
||
775 | 191 |
function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; |
192 |
var dY, dX: Extended; |
|
193 |
begin |
|
194 |
dY:= _dY.QWordValue / $100000000; |
|
195 |
if _dY.isNegative then dY:= - dY; |
|
196 |
dX:= _dX.QWordValue / $100000000; |
|
197 |
if _dX.isNegative then dX:= - dX; |
|
198 |
DxDy2Angle:= arctan2(dY, dX) * 180 / pi |
|
199 |
end; |
|
200 |
||
371 | 201 |
function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt; |
100 | 202 |
const _16divPI: Extended = 16/pi; |
370
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
203 |
var dY, dX: Extended; |
100 | 204 |
begin |
370
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
205 |
dY:= _dY.QWordValue / $100000000; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
206 |
if _dY.isNegative then dY:= - dY; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
207 |
dX:= _dX.QWordValue / $100000000; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
208 |
if _dX.isNegative then dX:= - dX; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
209 |
DxDy2Angle32:= trunc(arctan2(dY, dX) * _16divPI) and $1f |
4 | 210 |
end; |
211 |
||
371 | 212 |
function DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt; |
100 | 213 |
const MaxAngleDivPI: Extended = cMaxAngle/pi; |
370
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
214 |
var dY, dX: Extended; |
100 | 215 |
begin |
370
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
216 |
dY:= _dY.QWordValue / $100000000; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
217 |
if _dY.isNegative then dY:= - dY; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
218 |
dX:= _dX.QWordValue / $100000000; |
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
351
diff
changeset
|
219 |
if _dX.isNegative then dX:= - dX; |
438 | 220 |
DxDy2AttackAngle:= trunc(arctan2(dY, dX) * MaxAngleDivPI) |
100 | 221 |
end; |
4 | 222 |
|
208 | 223 |
procedure SetKB(n: Longword); |
224 |
begin |
|
225 |
KBnum:= n |
|
226 |
end; |
|
227 |
||
228 |
procedure SendKB; |
|
229 |
var s: shortstring; |
|
230 |
begin |
|
231 |
if KBnum <> 0 then |
|
232 |
begin |
|
233 |
s:= 'K' + inttostr(KBnum); |
|
234 |
SendIPCRaw(@s, Length(s) + 1) |
|
235 |
end |
|
236 |
end; |
|
237 |
||
351 | 238 |
procedure SetLittle(var r: hwFloat); |
300 | 239 |
begin |
553
5478386d935f
- Switch to bazooka (or whatever) after use of some weapon (fixes problem with bots)
unc0rr
parents:
543
diff
changeset
|
240 |
r:= SignAs(cLittle, r) |
300 | 241 |
end; |
242 |
||
337 | 243 |
procedure SendStat(sit: TStatInfoType; s: shortstring); |
869 | 244 |
const stc: array [TStatInfoType] of char = 'rDkK'; |
337 | 245 |
begin |
246 |
SendIPC('i' + stc[sit] + s) |
|
247 |
end; |
|
248 |
||
534 | 249 |
function Str2PChar(const s: shortstring): PChar; |
351 | 250 |
const CharArray: array[byte] of Char = ''; |
251 |
begin |
|
252 |
CharArray:= s; |
|
253 |
CharArray[Length(s)]:= #0; |
|
254 |
Str2PChar:= @CharArray |
|
255 |
end; |
|
256 |
||
771 | 257 |
function isPowerOf2(i: Longword): boolean; |
258 |
begin |
|
259 |
if i = 0 then exit(true); |
|
260 |
while (i and 1) = 0 do i:= i shr 1; |
|
261 |
isPowerOf2:= (i = 1) |
|
262 |
end; |
|
263 |
||
264 |
function toPowerOf2(i: Longword): Longword; |
|
265 |
begin |
|
266 |
toPowerOf2:= 1; |
|
267 |
while (toPowerOf2 < i) do toPowerOf2:= toPowerOf2 shl 1 |
|
268 |
end; |
|
269 |
||
755 | 270 |
function Surface2Tex(surf: PSDL_Surface): PTexture; |
753 | 271 |
var mode: LongInt; |
771 | 272 |
tw, th: Longword; |
273 |
tmpp: pointer; |
|
753 | 274 |
begin |
755 | 275 |
new(Surface2Tex); |
276 |
Surface2Tex^.w:= surf^.w; |
|
277 |
Surface2Tex^.h:= surf^.h; |
|
278 |
||
753 | 279 |
if (surf^.format^.BytesPerPixel = 3) then mode:= GL_RGB else |
280 |
if (surf^.format^.BytesPerPixel = 4) then mode:= GL_RGBA else |
|
281 |
begin |
|
869 | 282 |
TryDo(false, 'Surface2Tex: BytesPerPixel not in [3, 4]', true); |
755 | 283 |
Surface2Tex^.id:= 0; |
753 | 284 |
exit |
285 |
end; |
|
286 |
||
755 | 287 |
glGenTextures(1, @Surface2Tex^.id); |
753 | 288 |
|
755 | 289 |
glBindTexture(GL_TEXTURE_2D, Surface2Tex^.id); |
753 | 290 |
|
771 | 291 |
if SDL_MustLock(surf) then |
292 |
SDLTry(SDL_LockSurface(surf) >= 0, true); |
|
293 |
||
294 |
if not (isPowerOf2(Surf^.w) and isPowerOf2(Surf^.h)) then |
|
295 |
begin |
|
296 |
tw:= toPowerOf2(Surf^.w); |
|
297 |
th:= toPowerOf2(Surf^.h); |
|
298 |
||
299 |
GetMem(tmpp, tw * th * surf^.format^.BytesPerPixel); |
|
300 |
||
301 |
gluScaleImage(mode, Surf^.w, Surf^.h, GL_UNSIGNED_BYTE, |
|
302 |
Surf^.pixels, tw, th, GL_UNSIGNED_BYTE, |
|
303 |
tmpp); |
|
304 |
||
305 |
glTexImage2D(GL_TEXTURE_2D, 0, mode, tw, th, 0, mode, GL_UNSIGNED_BYTE, tmpp); |
|
306 |
||
307 |
FreeMem(tmpp, tw * th * surf^.format^.BytesPerPixel) |
|
308 |
end else |
|
309 |
glTexImage2D(GL_TEXTURE_2D, 0, mode, surf^.w, surf^.h, 0, mode, GL_UNSIGNED_BYTE, surf^.pixels); |
|
753 | 310 |
|
754 | 311 |
if SDL_MustLock(surf) then |
312 |
SDL_UnlockSurface(surf); |
|
313 |
||
788
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
785
diff
changeset
|
314 |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
00720357601f
- Get rid of PageSimpleGame, now pressing 'quick game' just starts round
unc0rr
parents:
785
diff
changeset
|
315 |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) |
753 | 316 |
end; |
317 |
||
759 | 318 |
procedure FreeTexture(tex: PTexture); |
319 |
begin |
|
320 |
glDeleteTextures(1, @tex^.id); |
|
321 |
dispose(tex) |
|
322 |
end; |
|
337 | 323 |
|
949 | 324 |
function DecodeBase64(s: shortstring): shortstring; |
325 |
const table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; |
|
326 |
var i, t, c: Longword; |
|
327 |
begin |
|
328 |
c:= 0; |
|
329 |
for i:= 1 to Length(s) do |
|
330 |
begin |
|
331 |
t:= Pos(s[i], table); |
|
332 |
if s[i] = '=' then inc(c); |
|
333 |
if t > 0 then byte(s[i]):= t - 1 else byte(s[i]):= 0 |
|
334 |
end; |
|
335 |
||
336 |
i:= 1; |
|
337 |
t:= 1; |
|
338 |
while i <= length(s) do |
|
339 |
begin |
|
340 |
DecodeBase64[t ]:= char((byte(s[i ]) shl 2) or (byte(s[i + 1]) shr 4)); |
|
341 |
DecodeBase64[t + 1]:= char((byte(s[i + 1]) shl 4) or (byte(s[i + 2]) shr 2)); |
|
342 |
DecodeBase64[t + 2]:= char((byte(s[i + 2]) shl 6) or (byte(s[i + 3]) )); |
|
343 |
inc(t, 3); |
|
344 |
inc(i, 4) |
|
345 |
end; |
|
346 |
||
347 |
if c < 3 then t:= t - c; |
|
348 |
||
349 |
byte(DecodeBase64[0]):= t - 1 |
|
350 |
end; |
|
351 |
||
1080 | 352 |
const GL_BGR = $80E0; // some opengl headers don't have that const (?) |
353 |
procedure MakeScreenshot(s: shortstring); |
|
354 |
const head: array[0..8] of Word = (0, 2, 0, 0, 0, 0, 0, 0, 24); |
|
355 |
var p: Pointer; |
|
356 |
size: Longword; |
|
357 |
f: file; |
|
358 |
begin |
|
359 |
head[6]:= cScreenWidth; |
|
360 |
head[7]:= cScreenHeight; |
|
361 |
||
362 |
size:= cScreenWidth * cScreenHeight * 3; |
|
363 |
p:= GetMem(size); |
|
364 |
||
365 |
glReadBuffer(GL_FRONT); |
|
366 |
glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGR, GL_UNSIGNED_BYTE, p); |
|
367 |
||
368 |
{$I-} |
|
369 |
Assign(f, s); |
|
370 |
Rewrite(f, 1); |
|
371 |
if IOResult = 0 then |
|
372 |
begin |
|
373 |
BlockWrite(f, head, sizeof(head)); |
|
374 |
BlockWrite(f, p^, size); |
|
375 |
Close(f); |
|
376 |
end; |
|
377 |
{$I+} |
|
378 |
||
379 |
FreeMem(p) |
|
380 |
end; |
|
381 |
||
949 | 382 |
{$IFDEF DEBUGFILE} |
383 |
procedure AddFileLog(s: shortstring); |
|
384 |
begin |
|
385 |
writeln(f, GameTicks: 6, ': ', s); |
|
386 |
flush(f) |
|
387 |
end; |
|
388 |
||
389 |
function RectToStr(Rect: TSDL_Rect): shortstring; |
|
390 |
begin |
|
391 |
RectToStr:= '(x: ' + inttostr(rect.x) + '; y: ' + inttostr(rect.y) + '; w: ' + inttostr(rect.w) + '; h: ' + inttostr(rect.h) + ')' |
|
392 |
end; |
|
393 |
||
371 | 394 |
var i: LongInt; |
488 | 395 |
{$ENDIF} |
306 | 396 |
|
4 | 397 |
initialization |
351 | 398 |
cDrownSpeed.QWordValue:= 257698038;// 0.06 |
488 | 399 |
cMaxWindSpeed.QWordValue:= 2147484;// 0.0005 |
400 |
cWindSpeed.QWordValue:= 429496;// 0.0001 |
|
351 | 401 |
cGravity:= cMaxWindSpeed; |
402 |
||
488 | 403 |
{$IFDEF DEBUGFILE} |
337 | 404 |
{$I-} |
497 | 405 |
if ParamCount > 0 then |
406 |
for i:= 0 to 7 do |
|
337 | 407 |
begin |
497 | 408 |
Assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt'); |
337 | 409 |
rewrite(f); |
410 |
if IOResult = 0 then break |
|
411 |
end; |
|
412 |
{$I+} |
|
17 | 413 |
|
4 | 414 |
finalization |
916 | 415 |
//uRandom.DumpBuffer; |
4 | 416 |
writeln(f, '-= halt at ',GameTicks,' ticks =-'); |
417 |
Flush(f); |
|
351 | 418 |
close(f) |
4 | 419 |
{$ENDIF} |
420 |
||
421 |
end. |