author | unc0rr |
Wed, 20 Sep 2006 15:33:47 +0000 | |
changeset 154 | 5667e6f38704 |
parent 146 | 458f4f58c1b6 |
child 161 | d8870bbf960e |
permissions | -rw-r--r-- |
4 | 1 |
(* |
2 |
* Hedgewars, a worms-like game |
|
47 | 3 |
* Copyright (c) 2004, 2005, 2006 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 4 |
* |
5 |
* Distributed under the terms of the BSD-modified licence: |
|
6 |
* |
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
8 |
* of this software and associated documentation files (the "Software"), to deal |
|
9 |
* with the Software without restriction, including without limitation the |
|
10 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|
11 |
* sell copies of the Software, and to permit persons to whom the Software is |
|
12 |
* furnished to do so, subject to the following conditions: |
|
13 |
* |
|
14 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
15 |
* this list of conditions and the following disclaimer. |
|
16 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
17 |
* this list of conditions and the following disclaimer in the documentation |
|
18 |
* and/or other materials provided with the distribution. |
|
19 |
* 3. The name of the author may not be used to endorse or promote products |
|
20 |
* derived from this software without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
|
23 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
24 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|
25 |
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
26 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
27 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|
28 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|
29 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
30 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|
31 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
*) |
|
33 |
||
34 |
unit uWorld; |
|
35 |
interface |
|
83 | 36 |
uses SDLh, uGears, uConsts; |
4 | 37 |
{$INCLUDE options.inc} |
38 |
const WorldDx: integer = -512; |
|
39 |
WorldDy: integer = -256; |
|
40 |
||
41 |
procedure InitWorld; |
|
42 |
procedure DrawWorld(Lag: integer; Surface: PSDL_Surface); |
|
108 | 43 |
procedure AddCaption(s: string; Color: Longword; Group: TCapGroup); |
79 | 44 |
procedure MoveCamera; |
4 | 45 |
|
46 |
{$IFDEF COUNTTICKS} |
|
47 |
var cntTicks: LongWord; |
|
48 |
{$ENDIF} |
|
49 |
var FollowGear: PGear = nil; |
|
6 | 50 |
WindBarWidth: integer = 0; |
4 | 51 |
|
52 |
implementation |
|
83 | 53 |
uses uStore, uMisc, uTeams, uIO, uConsole; |
4 | 54 |
const RealTicks: Longword = 0; |
55 |
Frames: Longword = 0; |
|
56 |
FPS: Longword = 0; |
|
57 |
CountTicks: Longword = 0; |
|
58 |
prevPoint: TPoint = (X: 0; Y: 0); |
|
59 |
||
60 |
type TCaptionStr = record |
|
83 | 61 |
Surf: PSDL_Surface; |
62 |
StorePos: Longword; |
|
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
95
diff
changeset
|
63 |
Group: TCapGroup; |
4 | 64 |
EndTime: LongWord; |
65 |
end; |
|
66 |
||
67 |
var cWaterSprCount: integer; |
|
97
e7c1df9cce2c
- make the game be run from ${PREFIX}/bin with data in ${PREFIX}/share/hedgewars/Data
unc0rr
parents:
95
diff
changeset
|
68 |
Captions: array[0..Pred(cMaxCaptions)] of TCaptionStr; |
4 | 69 |
|
70 |
procedure InitWorld; |
|
71 |
begin |
|
74 | 72 |
cWaterSprCount:= 1 + cScreenWidth div (SpritesData[sprWater].Width); |
73 |
cScreenEdgesDist:= Min(cScreenWidth div 4, cScreenHeight div 4); |
|
74 |
SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2); |
|
75 |
prevPoint.X:= cScreenWidth div 2; |
|
76 |
prevPoint.Y:= cScreenHeight div 2; |
|
77 |
WorldDx:= - 1024 + cScreenWidth div 2; |
|
78 |
WorldDy:= - 512 + cScreenHeight div 2 |
|
4 | 79 |
end; |
80 |
||
81 |
procedure DrawWorld(Lag: integer; Surface: PSDL_Surface); |
|
82 |
var i, t: integer; |
|
83 |
r: TSDL_Rect; |
|
84 |
team: PTeam; |
|
107 | 85 |
tdx, tdy: Double; |
80 | 86 |
|
82 | 87 |
procedure DrawRepeated(spr: TSprite; Shift: integer); |
80 | 88 |
var i, w: integer; |
89 |
begin |
|
90 |
w:= SpritesData[spr].Width; |
|
82 | 91 |
i:= Shift mod w; |
80 | 92 |
if i > 0 then dec(i, w); |
93 |
repeat |
|
94 |
DrawSprite(spr, i, WorldDy + 1024 - SpritesData[spr].Height, 0, Surface); |
|
95 |
inc(i, w) |
|
96 |
until i > cScreenWidth |
|
97 |
end; |
|
98 |
||
4 | 99 |
begin |
5 | 100 |
// Sky |
4 | 101 |
inc(RealTicks, Lag); |
109 | 102 |
if WorldDy > 0 then |
4 | 103 |
begin |
109 | 104 |
if WorldDy > cScreenHeight then r.h:= cScreenHeight |
105 |
else r.h:= WorldDy; |
|
4 | 106 |
r.x:= 0; |
107 |
r.y:= 0; |
|
108 |
r.w:= cScreenWidth; |
|
109 |
SDL_FillRect(Surface, @r, cSkyColor) |
|
110 |
end; |
|
5 | 111 |
// background |
82 | 112 |
DrawRepeated(sprSky, WorldDx * 3 div 8); |
113 |
DrawRepeated(sprHorizont, WorldDx * 3 div 5); |
|
4 | 114 |
|
5 | 115 |
// Waves |
4 | 116 |
{$WARNINGS OFF} |
56 | 117 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx + (RealTicks shr 6) ) and $FF), cWaterLine + WorldDy - 64, 0, Surface); |
118 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx - (RealTicks shr 6) + 192) and $FF), cWaterLine + WorldDy - 48, 0, Surface); |
|
4 | 119 |
{$WARNINGS ON} |
120 |
||
121 |
DrawLand(WorldDx, WorldDy, Surface); |
|
5 | 122 |
// Water |
4 | 123 |
r.y:= WorldDy + cWaterLine + 32; |
124 |
if r.y < cScreenHeight then |
|
125 |
begin |
|
23 | 126 |
if r.y < 0 then r.y:= 0; |
4 | 127 |
r.h:= cScreenHeight - r.y; |
128 |
r.x:= 0; |
|
129 |
r.w:= cScreenWidth; |
|
130 |
SDL_FillRect(Surface, @r, cWaterColor) |
|
131 |
end; |
|
132 |
||
133 |
DrawGears(Surface); |
|
134 |
||
95 | 135 |
if CurrentTeam <> nil then |
136 |
begin |
|
137 |
team:= TeamsList; |
|
138 |
while team<>nil do |
|
4 | 139 |
begin |
140 |
for i:= 0 to 7 do |
|
141 |
with team.Hedgehogs[i] do |
|
142 |
if Gear<>nil then |
|
143 |
if Gear.State = 0 then |
|
5 | 144 |
begin |
95 | 145 |
t:= round(Gear.Y) - cHHRadius - 10 + WorldDy; |
146 |
dec(t, HealthTag.h + 2); |
|
147 |
DrawCentered(round(Gear.X) + WorldDx, t, HealthTag, Surface); |
|
148 |
dec(t, NameTag.h + 2); |
|
149 |
DrawCentered(round(Gear.X) + WorldDx, t, NameTag, Surface); |
|
150 |
dec(t, Team.NameTag.h + 2); |
|
151 |
DrawCentered(round(Gear.X) + WorldDx, t, Team.NameTag, Surface) |
|
5 | 152 |
end else // Current hedgehog |
4 | 153 |
begin |
69 | 154 |
if (Gear.State and (gstMoving or gstDrowning or gstFalling)) = 0 then |
4 | 155 |
if (Gear.State and gstHHThinking) <> 0 then |
53 | 156 |
DrawGear(sQuestion, Round(Gear.X) - 10 + WorldDx, Round(Gear.Y) - cHHRadius - 34 + WorldDy, Surface) |
4 | 157 |
else |
69 | 158 |
if ShowCrosshair and ((Gear.State and gstAttacked) = 0) then |
108 | 159 |
DrawCaption(Round(Gear.X + hwSign(Gear.dX) * Sin(Gear.Angle*pi/cMaxAngle)*60) + WorldDx, |
39 | 160 |
Round(Gear.Y - Cos(Gear.Angle*pi/cMaxAngle)*60) + WorldDy - 4, |
4 | 161 |
Team.CrossHairRect, Surface) |
162 |
end; |
|
163 |
team:= team.Next |
|
164 |
end; |
|
95 | 165 |
end; |
166 |
||
4 | 167 |
|
5 | 168 |
// Waves |
4 | 169 |
{$WARNINGS OFF} |
56 | 170 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx + (RealTicks shr 6) + 64) and $FF), cWaterLine + WorldDy - 32, 0, Surface); |
171 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface); |
|
172 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx + (RealTicks shr 6) ) and $FF), cWaterLine + WorldDy , 0, Surface); |
|
4 | 173 |
{$WARNINGS ON} |
174 |
||
79 | 175 |
// Turn time |
4 | 176 |
if TurnTimeLeft <> 0 then |
177 |
begin |
|
178 |
i:= Succ(Pred(TurnTimeLeft) div 1000); |
|
179 |
if i>99 then t:= 112 |
|
180 |
else if i>9 then t:= 96 |
|
181 |
else t:= 80; |
|
182 |
DrawSprite(sprFrame, t, cScreenHeight - 48, 1, Surface); |
|
183 |
while i > 0 do |
|
184 |
begin |
|
185 |
dec(t, 32); |
|
186 |
DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface); |
|
187 |
i:= i div 10 |
|
188 |
end; |
|
189 |
DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface); |
|
190 |
end; |
|
79 | 191 |
|
192 |
// Attack bar |
|
4 | 193 |
if CurrentTeam <> nil then |
194 |
case AttackBar of |
|
195 |
1: begin |
|
196 |
r:= StuffPoz[sPowerBar]; |
|
197 |
{$WARNINGS OFF} |
|
198 |
r.w:= (CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear.Power * 256) div cPowerDivisor; |
|
199 |
{$WARNINGS ON} |
|
200 |
DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface); |
|
201 |
end; |
|
74 | 202 |
2: with CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog] do |
203 |
begin |
|
108 | 204 |
tdx:= hwSign(Gear.dX) * Sin(Gear.Angle*pi/cMaxAngle); |
74 | 205 |
tdy:= - Cos(Gear.Angle*pi/cMaxAngle); |
206 |
for i:= (Gear.Power * 24) div cPowerDivisor downto 0 do |
|
75 | 207 |
DrawSprite(sprPower, round(Gear.X + WorldDx + tdx * (24 + i * 2)) - 16, |
208 |
round(Gear.Y + WorldDy + tdy * (24 + i * 2)) - 12, |
|
74 | 209 |
i, Surface) |
210 |
end |
|
4 | 211 |
end; |
212 |
||
5 | 213 |
// Target |
4 | 214 |
if TargetPoint.X <> NoPointX then DrawSprite(sprTargetP, TargetPoint.X + WorldDx - 16, TargetPoint.Y + WorldDy - 16, 0, Surface); |
215 |
||
216 |
// Captions |
|
217 |
i:= 0; |
|
218 |
while (i < cMaxCaptions) do |
|
219 |
begin |
|
220 |
with Captions[i] do |
|
83 | 221 |
if EndTime > 0 then |
95 | 222 |
DrawCentered(cScreenWidth div 2, 8 + i * (Surf.h + 2) + cConsoleYAdd, Surf, Surface); |
4 | 223 |
inc(i) |
224 |
end; |
|
225 |
while (Captions[0].EndTime > 0) and (Captions[0].EndTime <= RealTicks) do |
|
226 |
begin |
|
83 | 227 |
SDL_FreeSurface(Captions[0].Surf); |
95 | 228 |
Captions[0].Surf:= nil; |
4 | 229 |
for i:= 1 to Pred(cMaxCaptions) do |
230 |
Captions[Pred(i)]:= Captions[i]; |
|
231 |
Captions[Pred(cMaxCaptions)].EndTime:= 0 |
|
232 |
end; |
|
233 |
||
47 | 234 |
// Teams Healths |
235 |
team:= TeamsList; |
|
236 |
while team <> nil do |
|
237 |
begin |
|
95 | 238 |
r.x:= cScreenWidth div 2 - team.NameTag.w - 3; |
239 |
r.y:= team.DrawHealthY; |
|
240 |
r.w:= team.NameTag.w; |
|
241 |
r.h:= team.NameTag.h; |
|
242 |
SDL_UpperBlit(team.NameTag, nil, Surface, @r); |
|
47 | 243 |
r:= team.HealthRect; |
146 | 244 |
r.w:= 2 + team.TeamHealthBarWidth; |
49 | 245 |
DrawFromStoreRect(cScreenWidth div 2, |
246 |
Team.DrawHealthY, |
|
47 | 247 |
@r, Surface); |
83 | 248 |
inc(r.x, cTeamHealthWidth + 2); |
249 |
r.w:= 3; |
|
146 | 250 |
DrawFromStoreRect(cScreenWidth div 2 + team.TeamHealthBarWidth + 2, |
49 | 251 |
Team.DrawHealthY, |
47 | 252 |
@r, Surface); |
253 |
team:= team.Next |
|
254 |
end; |
|
255 |
||
5 | 256 |
// Lag alert |
4 | 257 |
if isInLag then DrawSprite(sprLag, 32, 32 + cConsoleYAdd, (RealTicks shr 7) mod 7, Surface); |
258 |
||
5 | 259 |
// Wind bar |
260 |
DrawGear(sWindBar, cScreenWidth - 180, cScreenHeight - 30, Surface); |
|
6 | 261 |
if WindBarWidth > 0 then |
5 | 262 |
begin |
263 |
with StuffPoz[sWindR] do |
|
264 |
begin |
|
6 | 265 |
{$WARNINGS OFF} |
5 | 266 |
r.x:= x + 8 - (RealTicks shr 6) mod 8; |
6 | 267 |
{$WARNINGS ON} |
5 | 268 |
r.y:= y; |
6 | 269 |
r.w:= WindBarWidth; |
5 | 270 |
r.h:= 13; |
271 |
end; |
|
272 |
DrawSpriteFromRect(r, cScreenWidth - 103, cScreenHeight - 28, 13, 0, Surface); |
|
273 |
end else |
|
6 | 274 |
if WindBarWidth < 0 then |
5 | 275 |
begin |
276 |
with StuffPoz[sWindL] do |
|
277 |
begin |
|
6 | 278 |
{$WARNINGS OFF} |
279 |
r.x:= x + (WindBarWidth + RealTicks shr 6) mod 8; |
|
280 |
{$WARNINGS ON} |
|
5 | 281 |
r.y:= y; |
6 | 282 |
r.w:= - WindBarWidth; |
5 | 283 |
r.h:= 13; |
284 |
end; |
|
6 | 285 |
DrawSpriteFromRect(r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface); |
5 | 286 |
end; |
287 |
||
288 |
// Cursor |
|
4 | 289 |
if isCursorVisible then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface); |
290 |
||
291 |
{$IFDEF COUNTTICKS} |
|
292 |
DXOutText(10, 10, fnt16, inttostr(cntTicks), Surface); |
|
293 |
{$ENDIF} |
|
294 |
||
295 |
inc(Frames); |
|
296 |
inc(CountTicks, Lag); |
|
297 |
if CountTicks >= 1000 then |
|
298 |
begin |
|
299 |
FPS:= Frames; |
|
300 |
Frames:= 0; |
|
301 |
CountTicks:= 0; |
|
302 |
end; |
|
303 |
if cShowFPS then DXOutText(cScreenWidth - 50, 10, fnt16, inttostr(FPS) + ' fps', Surface) |
|
304 |
end; |
|
305 |
||
108 | 306 |
procedure AddCaption(s: string; Color: Longword; Group: TCapGroup); |
4 | 307 |
var i, t, m, k: LongWord; |
308 |
begin |
|
83 | 309 |
if Group in [capgrpGameState, capgrpNetSay] then WriteLnToConsole(s); |
4 | 310 |
i:= 0; |
83 | 311 |
while (i < cMaxCaptions) and (Captions[i].Group <> Group) do inc(i); |
4 | 312 |
if i < cMaxCaptions then |
313 |
begin |
|
95 | 314 |
SDL_FreeSurface(Captions[i].Surf); |
4 | 315 |
while (i < Pred(cMaxCaptions)) do |
316 |
begin |
|
317 |
Captions[i]:= Captions[Succ(i)]; |
|
318 |
inc(i) |
|
319 |
end; |
|
320 |
Captions[Pred(cMaxCaptions)].EndTime:= 0 |
|
321 |
end; |
|
322 |
||
323 |
if Captions[Pred(cMaxCaptions)].EndTime > 0 then |
|
324 |
begin |
|
95 | 325 |
SDL_FreeSurface(Captions[0].Surf); |
4 | 326 |
m:= Pred(cMaxCaptions); |
327 |
for i:= 1 to m do |
|
328 |
Captions[Pred(i)]:= Captions[i]; |
|
329 |
Captions[m].EndTime:= 0 |
|
330 |
end else |
|
331 |
begin |
|
332 |
m:= 0; |
|
333 |
while (m < cMaxCaptions)and(Captions[m].EndTime > 0) do inc(m) |
|
334 |
end; |
|
335 |
||
336 |
k:= 0; |
|
337 |
for i:= 0 to Pred(cMaxCaptions) do |
|
338 |
for t:= 0 to Pred(cMaxCaptions) do |
|
83 | 339 |
if (Captions[t].EndTime > 0) and (Captions[t].StorePos = k) then inc(k); |
4 | 340 |
|
95 | 341 |
Captions[m].Surf:= RenderString(s, Color, fntBig); |
4 | 342 |
Captions[m].StorePos:= k; |
343 |
Captions[m].Group:= Group; |
|
344 |
Captions[m].EndTime:= RealTicks + 1200 |
|
345 |
end; |
|
346 |
||
79 | 347 |
procedure MoveCamera; |
4 | 348 |
const PrevSentPointTime: LongWord = 0; |
349 |
begin |
|
350 |
if not (CurrentTeam.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y); |
|
351 |
if (FollowGear <> nil) then |
|
57 | 352 |
if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then |
4 | 353 |
begin |
354 |
FollowGear:= nil; |
|
355 |
exit |
|
356 |
end |
|
357 |
else begin |
|
108 | 358 |
CursorPoint.x:= (CursorPoint.x * 7 + (round(FollowGear.X + hwSign(FollowGear.dX) * 100) + WorldDx)) div 8; |
71 | 359 |
CursorPoint.y:= (CursorPoint.y * 7 + (round(FollowGear.Y) + WorldDy)) div 8 |
4 | 360 |
end; |
361 |
||
362 |
if ((CursorPoint.X = prevPoint.X)and(CursorPoint.Y = prevpoint.Y)) then exit; |
|
363 |
||
364 |
if isCursorVisible then |
|
365 |
begin |
|
366 |
if (not CurrentTeam.ExtDriven)and(GameTicks >= PrevSentPointTime + cSendCursorPosTime) then |
|
367 |
begin |
|
154
5667e6f38704
Network protocol uses integers in network byte order
unc0rr
parents:
146
diff
changeset
|
368 |
SendIPCXY('P', CursorPoint.X - WorldDx, CursorPoint.Y - WorldDy); |
4 | 369 |
PrevSentPointTime:= GameTicks |
370 |
end; |
|
371 |
end; |
|
372 |
if isCursorVisible or (FollowGear <> nil) then |
|
373 |
begin |
|
374 |
if CursorPoint.X < cScreenEdgesDist then |
|
375 |
begin |
|
376 |
WorldDx:= WorldDx - CursorPoint.X + cScreenEdgesDist; |
|
377 |
CursorPoint.X:= cScreenEdgesDist |
|
378 |
end else |
|
379 |
if CursorPoint.X > cScreenWidth - cScreenEdgesDist then |
|
380 |
begin |
|
381 |
WorldDx:= WorldDx - CursorPoint.X + cScreenWidth - cScreenEdgesDist; |
|
382 |
CursorPoint.X:= cScreenWidth - cScreenEdgesDist |
|
383 |
end; |
|
384 |
if CursorPoint.Y < cScreenEdgesDist then |
|
385 |
begin |
|
386 |
WorldDy:= WorldDy - CursorPoint.Y + cScreenEdgesDist; |
|
387 |
CursorPoint.Y:= cScreenEdgesDist |
|
388 |
end else |
|
389 |
if CursorPoint.Y > cScreenHeight - cScreenEdgesDist then |
|
390 |
begin |
|
391 |
WorldDy:= WorldDy - CursorPoint.Y + cScreenHeight - cScreenEdgesDist; |
|
392 |
CursorPoint.Y:= cScreenHeight - cScreenEdgesDist |
|
393 |
end; |
|
394 |
end else |
|
395 |
begin |
|
70 | 396 |
WorldDx:= WorldDx - CursorPoint.X + prevPoint.X; |
397 |
WorldDy:= WorldDy - CursorPoint.Y + prevPoint.Y; |
|
4 | 398 |
CursorPoint.X:= (cScreenWidth shr 1); |
399 |
CursorPoint.Y:= (cScreenHeight shr 1); |
|
400 |
end; |
|
401 |
SDL_WarpMouse(CursorPoint.X, CursorPoint.Y); |
|
402 |
prevPoint:= CursorPoint; |
|
75 | 403 |
if WorldDy < cScreenHeight - cWaterLine - cVisibleWater then WorldDy:= cScreenHeight - cWaterLine - cVisibleWater; |
4 | 404 |
if WorldDy > 2048 then WorldDy:= 2048; |
405 |
if WorldDx < -2048 then WorldDx:= -2048; |
|
406 |
if WorldDx > cScreenWidth then WorldDx:= cScreenWidth; |
|
407 |
end; |
|
408 |
||
409 |
initialization |
|
410 |
FillChar(Captions, sizeof(Captions), 0) |
|
411 |
||
412 |
end. |