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);
|
83
|
43 |
procedure AddCaption(s: shortstring; 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;
|
|
63 |
Group: TCapGroup;
|
4
|
64 |
EndTime: LongWord;
|
|
65 |
end;
|
|
66 |
|
|
67 |
var cWaterSprCount: integer;
|
|
68 |
Captions: array[0..Pred(cMaxCaptions)] of TCaptionStr;
|
|
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;
|
74
|
85 |
tdx, tdy: real;
|
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);
|
|
102 |
r.h:= WorldDy;
|
|
103 |
if r.h > 0 then
|
|
104 |
begin
|
|
105 |
if r.h > cScreenHeight then r.h:= cScreenHeight;
|
|
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 |
|
|
135 |
team:= TeamsList;
|
|
136 |
while team<>nil do
|
|
137 |
begin
|
|
138 |
for i:= 0 to 7 do
|
|
139 |
with team.Hedgehogs[i] do
|
|
140 |
if Gear<>nil then
|
|
141 |
if Gear.State = 0 then
|
5
|
142 |
begin
|
4
|
143 |
DrawCaption( round(Gear.X) + WorldDx,
|
53
|
144 |
round(Gear.Y) - cHHRadius - 30 + WorldDy,
|
4
|
145 |
HealthRect, Surface, true);
|
|
146 |
DrawCaption( round(Gear.X) + WorldDx,
|
53
|
147 |
round(Gear.Y) - cHHRadius - 54 + WorldDy,
|
4
|
148 |
NameRect, Surface);
|
|
149 |
// DrawCaption( round(Gear.X) + WorldDx,
|
53
|
150 |
// round(Gear.Y) - Gear.Radius - 60 + WorldDy,
|
4
|
151 |
// Team.NameRect, 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
|
4
|
159 |
DrawCaption(Round(Gear.X + Sign(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;
|
|
165 |
|
5
|
166 |
// Waves
|
4
|
167 |
{$WARNINGS OFF}
|
56
|
168 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx + (RealTicks shr 6) + 64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
|
|
169 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
|
|
170 |
for i:= -1 to cWaterSprCount do DrawSprite(sprWater, i * 256 + ((WorldDx + (RealTicks shr 6) ) and $FF), cWaterLine + WorldDy , 0, Surface);
|
4
|
171 |
{$WARNINGS ON}
|
|
172 |
|
79
|
173 |
// Turn time
|
4
|
174 |
if TurnTimeLeft <> 0 then
|
|
175 |
begin
|
|
176 |
i:= Succ(Pred(TurnTimeLeft) div 1000);
|
|
177 |
if i>99 then t:= 112
|
|
178 |
else if i>9 then t:= 96
|
|
179 |
else t:= 80;
|
|
180 |
DrawSprite(sprFrame, t, cScreenHeight - 48, 1, Surface);
|
|
181 |
while i > 0 do
|
|
182 |
begin
|
|
183 |
dec(t, 32);
|
|
184 |
DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
|
|
185 |
i:= i div 10
|
|
186 |
end;
|
|
187 |
DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
|
|
188 |
end;
|
79
|
189 |
|
|
190 |
// Attack bar
|
4
|
191 |
if CurrentTeam <> nil then
|
|
192 |
case AttackBar of
|
|
193 |
1: begin
|
|
194 |
r:= StuffPoz[sPowerBar];
|
|
195 |
{$WARNINGS OFF}
|
|
196 |
r.w:= (CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear.Power * 256) div cPowerDivisor;
|
|
197 |
{$WARNINGS ON}
|
|
198 |
DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
|
|
199 |
end;
|
74
|
200 |
2: with CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog] do
|
|
201 |
begin
|
|
202 |
tdx:= Sign(Gear.dX) * Sin(Gear.Angle*pi/cMaxAngle);
|
|
203 |
tdy:= - Cos(Gear.Angle*pi/cMaxAngle);
|
|
204 |
for i:= (Gear.Power * 24) div cPowerDivisor downto 0 do
|
75
|
205 |
DrawSprite(sprPower, round(Gear.X + WorldDx + tdx * (24 + i * 2)) - 16,
|
|
206 |
round(Gear.Y + WorldDy + tdy * (24 + i * 2)) - 12,
|
74
|
207 |
i, Surface)
|
|
208 |
end
|
4
|
209 |
end;
|
|
210 |
|
5
|
211 |
// Target
|
4
|
212 |
if TargetPoint.X <> NoPointX then DrawSprite(sprTargetP, TargetPoint.X + WorldDx - 16, TargetPoint.Y + WorldDy - 16, 0, Surface);
|
|
213 |
|
|
214 |
// Captions
|
|
215 |
i:= 0;
|
|
216 |
while (i < cMaxCaptions) do
|
|
217 |
begin
|
|
218 |
with Captions[i] do
|
83
|
219 |
if EndTime > 0 then
|
|
220 |
begin
|
|
221 |
r.x:= (cScreenWidth - Surf.w) div 2;
|
|
222 |
r.y:= 8 + i * (Surf.h + 2) + cConsoleYAdd;
|
|
223 |
r.w:= Surf.w;
|
|
224 |
r.h:= Surf.h;
|
|
225 |
SDL_UpperBlit(Surf, nil, Surface, @r)
|
|
226 |
end;
|
4
|
227 |
inc(i)
|
|
228 |
end;
|
|
229 |
while (Captions[0].EndTime > 0) and (Captions[0].EndTime <= RealTicks) do
|
|
230 |
begin
|
83
|
231 |
SDL_FreeSurface(Captions[0].Surf);
|
4
|
232 |
for i:= 1 to Pred(cMaxCaptions) do
|
|
233 |
Captions[Pred(i)]:= Captions[i];
|
|
234 |
Captions[Pred(cMaxCaptions)].EndTime:= 0
|
|
235 |
end;
|
|
236 |
|
47
|
237 |
// Teams Healths
|
|
238 |
team:= TeamsList;
|
|
239 |
while team <> nil do
|
|
240 |
begin
|
49
|
241 |
DrawFromStoreRect(cScreenWidth div 2 - team.NameRect.w - 3,
|
|
242 |
Team.DrawHealthY,
|
47
|
243 |
@team.NameRect, Surface);
|
|
244 |
r:= team.HealthRect;
|
83
|
245 |
r.w:= 2 + team.TeamHealth;
|
49
|
246 |
DrawFromStoreRect(cScreenWidth div 2,
|
|
247 |
Team.DrawHealthY,
|
47
|
248 |
@r, Surface);
|
83
|
249 |
inc(r.x, cTeamHealthWidth + 2);
|
|
250 |
r.w:= 3;
|
|
251 |
DrawFromStoreRect(cScreenWidth div 2 + team.TeamHealth + 2,
|
49
|
252 |
Team.DrawHealthY,
|
47
|
253 |
@r, Surface);
|
|
254 |
team:= team.Next
|
|
255 |
end;
|
|
256 |
|
5
|
257 |
// Lag alert
|
4
|
258 |
if isInLag then DrawSprite(sprLag, 32, 32 + cConsoleYAdd, (RealTicks shr 7) mod 7, Surface);
|
|
259 |
|
5
|
260 |
// Wind bar
|
|
261 |
DrawGear(sWindBar, cScreenWidth - 180, cScreenHeight - 30, Surface);
|
6
|
262 |
if WindBarWidth > 0 then
|
5
|
263 |
begin
|
|
264 |
with StuffPoz[sWindR] do
|
|
265 |
begin
|
6
|
266 |
{$WARNINGS OFF}
|
5
|
267 |
r.x:= x + 8 - (RealTicks shr 6) mod 8;
|
6
|
268 |
{$WARNINGS ON}
|
5
|
269 |
r.y:= y;
|
6
|
270 |
r.w:= WindBarWidth;
|
5
|
271 |
r.h:= 13;
|
|
272 |
end;
|
|
273 |
DrawSpriteFromRect(r, cScreenWidth - 103, cScreenHeight - 28, 13, 0, Surface);
|
|
274 |
end else
|
6
|
275 |
if WindBarWidth < 0 then
|
5
|
276 |
begin
|
|
277 |
with StuffPoz[sWindL] do
|
|
278 |
begin
|
6
|
279 |
{$WARNINGS OFF}
|
|
280 |
r.x:= x + (WindBarWidth + RealTicks shr 6) mod 8;
|
|
281 |
{$WARNINGS ON}
|
5
|
282 |
r.y:= y;
|
6
|
283 |
r.w:= - WindBarWidth;
|
5
|
284 |
r.h:= 13;
|
|
285 |
end;
|
6
|
286 |
DrawSpriteFromRect(r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface);
|
5
|
287 |
end;
|
|
288 |
|
|
289 |
// Cursor
|
4
|
290 |
if isCursorVisible then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface);
|
|
291 |
|
|
292 |
{$IFDEF COUNTTICKS}
|
|
293 |
DXOutText(10, 10, fnt16, inttostr(cntTicks), Surface);
|
|
294 |
{$ENDIF}
|
|
295 |
|
|
296 |
inc(Frames);
|
|
297 |
inc(CountTicks, Lag);
|
|
298 |
if CountTicks >= 1000 then
|
|
299 |
begin
|
|
300 |
FPS:= Frames;
|
|
301 |
Frames:= 0;
|
|
302 |
CountTicks:= 0;
|
|
303 |
end;
|
|
304 |
if cShowFPS then DXOutText(cScreenWidth - 50, 10, fnt16, inttostr(FPS) + ' fps', Surface)
|
|
305 |
end;
|
|
306 |
|
83
|
307 |
procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
|
4
|
308 |
var i, t, m, k: LongWord;
|
|
309 |
begin
|
83
|
310 |
if Group in [capgrpGameState, capgrpNetSay] then WriteLnToConsole(s);
|
4
|
311 |
i:= 0;
|
83
|
312 |
while (i < cMaxCaptions) and (Captions[i].Group <> Group) do inc(i);
|
4
|
313 |
if i < cMaxCaptions then
|
|
314 |
begin
|
|
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
|
|
325 |
m:= Pred(cMaxCaptions);
|
|
326 |
for i:= 1 to m do
|
|
327 |
Captions[Pred(i)]:= Captions[i];
|
|
328 |
Captions[m].EndTime:= 0
|
|
329 |
end else
|
|
330 |
begin
|
|
331 |
m:= 0;
|
|
332 |
while (m < cMaxCaptions)and(Captions[m].EndTime > 0) do inc(m)
|
|
333 |
end;
|
|
334 |
|
|
335 |
k:= 0;
|
|
336 |
for i:= 0 to Pred(cMaxCaptions) do
|
|
337 |
for t:= 0 to Pred(cMaxCaptions) do
|
83
|
338 |
if (Captions[t].EndTime > 0) and (Captions[t].StorePos = k) then inc(k);
|
4
|
339 |
|
83
|
340 |
Captions[m].Surf:= RenderString(s, Color, k);
|
4
|
341 |
Captions[m].StorePos:= k;
|
|
342 |
Captions[m].Group:= Group;
|
|
343 |
Captions[m].EndTime:= RealTicks + 1200
|
|
344 |
end;
|
|
345 |
|
79
|
346 |
procedure MoveCamera;
|
4
|
347 |
const PrevSentPointTime: LongWord = 0;
|
|
348 |
var s: string[9];
|
|
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
|
71
|
358 |
CursorPoint.x:= (CursorPoint.x * 7 + (round(FollowGear.X + Sign(FollowGear.dX) * 100) + WorldDx)) div 8;
|
|
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
|
|
368 |
s[0]:= #9;
|
|
369 |
s[1]:= 'P';
|
|
370 |
PInteger(@s[2])^:= CursorPoint.X - WorldDx;
|
|
371 |
PInteger(@s[6])^:= CursorPoint.Y - WorldDy;
|
|
372 |
SendIPC(s);
|
|
373 |
PrevSentPointTime:= GameTicks
|
|
374 |
end;
|
|
375 |
end;
|
|
376 |
if isCursorVisible or (FollowGear <> nil) then
|
|
377 |
begin
|
|
378 |
if CursorPoint.X < cScreenEdgesDist then
|
|
379 |
begin
|
|
380 |
WorldDx:= WorldDx - CursorPoint.X + cScreenEdgesDist;
|
|
381 |
CursorPoint.X:= cScreenEdgesDist
|
|
382 |
end else
|
|
383 |
if CursorPoint.X > cScreenWidth - cScreenEdgesDist then
|
|
384 |
begin
|
|
385 |
WorldDx:= WorldDx - CursorPoint.X + cScreenWidth - cScreenEdgesDist;
|
|
386 |
CursorPoint.X:= cScreenWidth - cScreenEdgesDist
|
|
387 |
end;
|
|
388 |
if CursorPoint.Y < cScreenEdgesDist then
|
|
389 |
begin
|
|
390 |
WorldDy:= WorldDy - CursorPoint.Y + cScreenEdgesDist;
|
|
391 |
CursorPoint.Y:= cScreenEdgesDist
|
|
392 |
end else
|
|
393 |
if CursorPoint.Y > cScreenHeight - cScreenEdgesDist then
|
|
394 |
begin
|
|
395 |
WorldDy:= WorldDy - CursorPoint.Y + cScreenHeight - cScreenEdgesDist;
|
|
396 |
CursorPoint.Y:= cScreenHeight - cScreenEdgesDist
|
|
397 |
end;
|
|
398 |
end else
|
|
399 |
begin
|
70
|
400 |
WorldDx:= WorldDx - CursorPoint.X + prevPoint.X;
|
|
401 |
WorldDy:= WorldDy - CursorPoint.Y + prevPoint.Y;
|
4
|
402 |
CursorPoint.X:= (cScreenWidth shr 1);
|
|
403 |
CursorPoint.Y:= (cScreenHeight shr 1);
|
|
404 |
end;
|
|
405 |
SDL_WarpMouse(CursorPoint.X, CursorPoint.Y);
|
|
406 |
prevPoint:= CursorPoint;
|
75
|
407 |
if WorldDy < cScreenHeight - cWaterLine - cVisibleWater then WorldDy:= cScreenHeight - cWaterLine - cVisibleWater;
|
4
|
408 |
if WorldDy > 2048 then WorldDy:= 2048;
|
|
409 |
if WorldDx < -2048 then WorldDx:= -2048;
|
|
410 |
if WorldDx > cScreenWidth then WorldDx:= cScreenWidth;
|
|
411 |
end;
|
|
412 |
|
|
413 |
initialization
|
|
414 |
FillChar(Captions, sizeof(Captions), 0)
|
|
415 |
|
|
416 |
end.
|