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