author | unc0rr |
Sun, 27 Jul 2008 15:28:49 +0000 | |
changeset 1115 | 81fdeaa349a0 |
parent 1097 | 06b15817b8a0 |
child 1131 | c5b8f2bfa487 |
permissions | -rw-r--r-- |
184 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
883 | 3 |
* Copyright (c) 2005-2008 Andrey Korotaev <unC0Rr@gmail.com> |
184 | 4 |
* |
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 |
|
8 |
* |
|
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. |
|
13 |
* |
|
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 |
|
17 |
*) |
|
18 |
||
19 |
unit uLandObjects; |
|
20 |
interface |
|
21 |
uses SDLh; |
|
22 |
{$include options.inc} |
|
23 |
||
24 |
procedure AddObjects(InSurface, Surface: PSDL_Surface); |
|
1085
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
25 |
procedure LoadThemeConfig; |
184 | 26 |
procedure BlitImageAndGenerateCollisionInfo(cpX, cpY: Longword; Image, Surface: PSDL_Surface); |
27 |
||
28 |
implementation |
|
1097 | 29 |
uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uFloat, GL, uSound; |
184 | 30 |
const MaxRects = 256; |
31 |
MAXOBJECTRECTS = 16; |
|
32 |
MAXTHEMEOBJECTS = 32; |
|
33 |
||
34 |
type PRectArray = ^TRectsArray; |
|
35 |
TRectsArray = array[0..MaxRects] of TSDL_Rect; |
|
36 |
TThemeObject = record |
|
37 |
Surf: PSDL_Surface; |
|
38 |
inland: TSDL_Rect; |
|
39 |
outland: array[0..Pred(MAXOBJECTRECTS)] of TSDL_Rect; |
|
40 |
rectcnt: Longword; |
|
41 |
Width, Height: Longword; |
|
42 |
Maxcnt: Longword; |
|
43 |
end; |
|
44 |
TThemeObjects = record |
|
371 | 45 |
Count: LongInt; |
184 | 46 |
objs: array[0..Pred(MAXTHEMEOBJECTS)] of TThemeObject; |
47 |
end; |
|
48 |
TSprayObject = record |
|
49 |
Surf: PSDL_Surface; |
|
50 |
Width, Height: Longword; |
|
51 |
Maxcnt: Longword; |
|
52 |
end; |
|
53 |
TSprayObjects = record |
|
371 | 54 |
Count: LongInt; |
184 | 55 |
objs: array[0..Pred(MAXTHEMEOBJECTS)] of TSprayObject |
56 |
end; |
|
57 |
||
58 |
var Rects: PRectArray; |
|
59 |
RectCount: Longword; |
|
1085
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
60 |
ThemeObjects: TThemeObjects; |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
61 |
SprayObjects: TSprayObjects; |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
62 |
|
184 | 63 |
|
64 |
procedure BlitImageAndGenerateCollisionInfo(cpX, cpY: Longword; Image, Surface: PSDL_Surface); |
|
65 |
var p: PByteArray; |
|
66 |
x, y: Longword; |
|
371 | 67 |
bpp: LongInt; |
184 | 68 |
r: TSDL_Rect; |
69 |
begin |
|
70 |
r.x:= cpX; |
|
71 |
r.y:= cpY; |
|
72 |
SDL_UpperBlit(Image, nil, Surface, @r); |
|
73 |
WriteToConsole('Generating collision info... '); |
|
74 |
||
75 |
if SDL_MustLock(Image) then |
|
76 |
SDLTry(SDL_LockSurface(Image) >= 0, true); |
|
77 |
||
351 | 78 |
bpp:= Image^.format^.BytesPerPixel; |
184 | 79 |
WriteToConsole('('+inttostr(bpp)+') '); |
351 | 80 |
p:= Image^.pixels; |
184 | 81 |
case bpp of |
82 |
1: OutError('We don''t work with 8 bit surfaces', true); |
|
351 | 83 |
2: for y:= 0 to Pred(Image^.h) do |
184 | 84 |
begin |
351 | 85 |
for x:= 0 to Pred(Image^.w) do |
86 |
if PWord(@(p^[x * 2]))^ <> 0 then Land[cpY + y, cpX + x]:= COLOR_LAND; |
|
87 |
p:= @(p^[Image^.pitch]); |
|
184 | 88 |
end; |
351 | 89 |
3: for y:= 0 to Pred(Image^.h) do |
184 | 90 |
begin |
351 | 91 |
for x:= 0 to Pred(Image^.w) do |
92 |
if (p^[x * 3 + 0] <> 0) |
|
93 |
or (p^[x * 3 + 1] <> 0) |
|
94 |
or (p^[x * 3 + 2] <> 0) then Land[cpY + y, cpX + x]:= COLOR_LAND; |
|
95 |
p:= @(p^[Image^.pitch]); |
|
184 | 96 |
end; |
351 | 97 |
4: for y:= 0 to Pred(Image^.h) do |
184 | 98 |
begin |
351 | 99 |
for x:= 0 to Pred(Image^.w) do |
100 |
if PLongword(@(p^[x * 4]))^ <> 0 then Land[cpY + y, cpX + x]:= COLOR_LAND; |
|
101 |
p:= @(p^[Image^.pitch]); |
|
184 | 102 |
end; |
103 |
end; |
|
104 |
if SDL_MustLock(Image) then |
|
105 |
SDL_UnlockSurface(Image); |
|
106 |
WriteLnToConsole(msgOK) |
|
107 |
end; |
|
108 |
||
371 | 109 |
procedure AddRect(x1, y1, w1, h1: LongInt); |
184 | 110 |
begin |
351 | 111 |
with Rects^[RectCount] do |
184 | 112 |
begin |
113 |
x:= x1; |
|
114 |
y:= y1; |
|
115 |
w:= w1; |
|
116 |
h:= h1 |
|
117 |
end; |
|
118 |
inc(RectCount); |
|
119 |
TryDo(RectCount < MaxRects, 'AddRect: overflow', true) |
|
120 |
end; |
|
121 |
||
122 |
procedure InitRects; |
|
123 |
begin |
|
124 |
RectCount:= 0; |
|
125 |
New(Rects) |
|
126 |
end; |
|
127 |
||
128 |
procedure FreeRects; |
|
129 |
begin |
|
130 |
Dispose(rects) |
|
131 |
end; |
|
132 |
||
371 | 133 |
function CheckIntersect(x1, y1, w1, h1: LongInt): boolean; |
184 | 134 |
var i: Longword; |
351 | 135 |
Result: boolean; |
184 | 136 |
begin |
137 |
Result:= false; |
|
138 |
i:= 0; |
|
139 |
if RectCount > 0 then |
|
140 |
repeat |
|
351 | 141 |
with Rects^[i] do |
184 | 142 |
Result:= (x < x1 + w1) and (x1 < x + w) and |
143 |
(y < y1 + h1) and (y1 < y + h); |
|
144 |
inc(i) |
|
351 | 145 |
until (i = RectCount) or (Result); |
146 |
CheckIntersect:= Result |
|
184 | 147 |
end; |
148 |
||
371 | 149 |
function AddGirder(gX: LongInt; Surface: PSDL_Surface): boolean; |
184 | 150 |
var tmpsurf: PSDL_Surface; |
371 | 151 |
x1, x2, y, k, i: LongInt; |
184 | 152 |
r, rr: TSDL_Rect; |
351 | 153 |
Result: boolean; |
184 | 154 |
|
371 | 155 |
function CountNonZeroz(x, y: LongInt): Longword; |
156 |
var i: LongInt; |
|
351 | 157 |
Result: Longword; |
184 | 158 |
begin |
159 |
Result:= 0; |
|
160 |
for i:= y to y + 15 do |
|
351 | 161 |
if Land[i, x] <> 0 then inc(Result); |
162 |
CountNonZeroz:= Result |
|
184 | 163 |
end; |
164 |
||
165 |
begin |
|
166 |
y:= 150; |
|
167 |
repeat |
|
168 |
inc(y, 24); |
|
169 |
x1:= gX; |
|
170 |
x2:= gX; |
|
171 |
while (x1 > 100) and (CountNonZeroz(x1, y) = 0) do dec(x1, 2); |
|
172 |
i:= x1 - 12; |
|
173 |
repeat |
|
174 |
k:= CountNonZeroz(x1, y); |
|
175 |
dec(x1, 2) |
|
176 |
until (x1 < 100) or (k = 0) or (k = 16) or (x1 < i); |
|
177 |
inc(x1, 2); |
|
178 |
if k = 16 then |
|
179 |
begin |
|
180 |
while (x2 < 1900) and (CountNonZeroz(x2, y) = 0) do inc(x2, 2); |
|
181 |
i:= x2 + 12; |
|
182 |
repeat |
|
183 |
k:= CountNonZeroz(x2, y); |
|
184 |
inc(x2, 2) |
|
185 |
until (x2 > 1900) or (k = 0) or (k = 16) or (x2 > i); |
|
186 |
if (x2 < 1900) and (k = 16) and (x2 - x1 > 250) |
|
187 |
and not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144) then break; |
|
188 |
end; |
|
189 |
x1:= 0; |
|
190 |
until y > 900; |
|
191 |
if x1 > 0 then |
|
192 |
begin |
|
193 |
Result:= true; |
|
351 | 194 |
tmpsurf:= LoadImage(Pathz[ptGraphics] + '/Girder', false, true, true); |
184 | 195 |
rr.x:= x1; |
196 |
rr.y:= y; |
|
197 |
while rr.x + 100 < x2 do |
|
198 |
begin |
|
199 |
SDL_UpperBlit(tmpsurf, nil, Surface, @rr); |
|
200 |
inc(rr.x, 100); |
|
201 |
end; |
|
202 |
r.x:= 0; |
|
203 |
r.y:= 0; |
|
204 |
r.w:= x2 - rr.x; |
|
205 |
r.h:= 16; |
|
206 |
SDL_UpperBlit(tmpsurf, @r, Surface, @rr); |
|
207 |
SDL_FreeSurface(tmpsurf); |
|
208 |
AddRect(x1 - 8, y - 32, x2 - x1 + 16, 80); |
|
209 |
for k:= y to y + 15 do |
|
210 |
for i:= x1 to x2 do Land[k, i]:= $FFFFFF |
|
351 | 211 |
end else Result:= false; |
212 |
AddGirder:= Result |
|
184 | 213 |
end; |
214 |
||
215 |
function CheckLand(rect: TSDL_Rect; dX, dY, Color: Longword): boolean; |
|
216 |
var i: Longword; |
|
351 | 217 |
Result: boolean; |
184 | 218 |
begin |
219 |
Result:= true; |
|
220 |
inc(rect.x, dX); |
|
221 |
inc(rect.y, dY); |
|
222 |
i:= 0; |
|
223 |
{$WARNINGS OFF} |
|
224 |
while (i <= rect.w) and Result do |
|
225 |
begin |
|
226 |
Result:= (Land[rect.y, rect.x + i] = Color) and (Land[rect.y + rect.h, rect.x + i] = Color); |
|
227 |
inc(i) |
|
228 |
end; |
|
229 |
i:= 0; |
|
230 |
while (i <= rect.h) and Result do |
|
231 |
begin |
|
232 |
Result:= (Land[rect.y + i, rect.x] = Color) and (Land[rect.y + i, rect.x + rect.w] = Color); |
|
233 |
inc(i) |
|
234 |
end; |
|
235 |
{$WARNINGS ON} |
|
351 | 236 |
CheckLand:= Result |
184 | 237 |
end; |
238 |
||
239 |
function CheckCanPlace(x, y: Longword; var Obj: TThemeObject): boolean; |
|
240 |
var i: Longword; |
|
351 | 241 |
Result: boolean; |
184 | 242 |
begin |
243 |
with Obj do |
|
244 |
if CheckLand(inland, x, y, $FFFFFF) then |
|
245 |
begin |
|
246 |
Result:= true; |
|
247 |
i:= 1; |
|
248 |
while Result and (i <= rectcnt) do |
|
249 |
begin |
|
250 |
Result:= CheckLand(outland[i], x, y, 0); |
|
251 |
inc(i) |
|
252 |
end; |
|
253 |
if Result then |
|
254 |
Result:= not CheckIntersect(x, y, Width, Height) |
|
255 |
end else |
|
351 | 256 |
Result:= false; |
257 |
CheckCanPlace:= Result |
|
184 | 258 |
end; |
259 |
||
260 |
function TryPut(var Obj: TThemeObject; Surface: PSDL_Surface): boolean; overload; |
|
261 |
const MaxPointsIndex = 2047; |
|
262 |
var x, y: Longword; |
|
263 |
ar: array[0..MaxPointsIndex] of TPoint; |
|
264 |
cnt, i: Longword; |
|
351 | 265 |
Result: boolean; |
184 | 266 |
begin |
267 |
cnt:= 0; |
|
268 |
with Obj do |
|
269 |
begin |
|
270 |
if Maxcnt = 0 then |
|
351 | 271 |
exit(false); |
184 | 272 |
x:= 0; |
273 |
repeat |
|
274 |
y:= 0; |
|
275 |
repeat |
|
276 |
if CheckCanPlace(x, y, Obj) then |
|
277 |
begin |
|
278 |
ar[cnt].x:= x; |
|
279 |
ar[cnt].y:= y; |
|
280 |
inc(cnt); |
|
281 |
if cnt > MaxPointsIndex then // buffer is full, do not check the rest land |
|
282 |
begin |
|
283 |
y:= 5000; |
|
284 |
x:= 5000; |
|
285 |
end |
|
286 |
end; |
|
287 |
inc(y, 3); |
|
288 |
until y > 1023 - Height; |
|
289 |
inc(x, getrandom(6) + 3) |
|
290 |
until x > 2047 - Width; |
|
291 |
Result:= cnt <> 0; |
|
292 |
if Result then |
|
293 |
begin |
|
294 |
i:= getrandom(cnt); |
|
295 |
BlitImageAndGenerateCollisionInfo(ar[i].x, ar[i].y, Obj.Surf, Surface); |
|
296 |
AddRect(ar[i].x, ar[i].y, Width, Height); |
|
297 |
dec(Maxcnt) |
|
298 |
end else Maxcnt:= 0 |
|
351 | 299 |
end; |
300 |
TryPut:= Result |
|
184 | 301 |
end; |
302 |
||
303 |
function TryPut(var Obj: TSprayObject; Surface: PSDL_Surface): boolean; overload; |
|
304 |
const MaxPointsIndex = 8095; |
|
305 |
var x, y: Longword; |
|
306 |
ar: array[0..MaxPointsIndex] of TPoint; |
|
307 |
cnt, i: Longword; |
|
308 |
r: TSDL_Rect; |
|
351 | 309 |
Result: boolean; |
184 | 310 |
begin |
311 |
cnt:= 0; |
|
312 |
with Obj do |
|
313 |
begin |
|
314 |
if Maxcnt = 0 then |
|
351 | 315 |
exit(false); |
184 | 316 |
x:= 0; |
317 |
r.x:= 0; |
|
318 |
r.y:= 0; |
|
319 |
r.w:= Width; |
|
320 |
r.h:= Height + 16; |
|
321 |
repeat |
|
322 |
y:= 8; |
|
323 |
repeat |
|
324 |
if CheckLand(r, x, y - 8, $FFFFFF) |
|
325 |
and not CheckIntersect(x, y, Width, Height) then |
|
326 |
begin |
|
327 |
ar[cnt].x:= x; |
|
328 |
ar[cnt].y:= y; |
|
329 |
inc(cnt); |
|
330 |
if cnt > MaxPointsIndex then // buffer is full, do not check the rest land |
|
331 |
begin |
|
332 |
y:= 5000; |
|
333 |
x:= 5000; |
|
334 |
end |
|
335 |
end; |
|
336 |
inc(y, 12); |
|
337 |
until y > 1023 - Height - 8; |
|
338 |
inc(x, getrandom(12) + 12) |
|
339 |
until x > 2047 - Width; |
|
340 |
Result:= cnt <> 0; |
|
341 |
if Result then |
|
342 |
begin |
|
343 |
i:= getrandom(cnt); |
|
344 |
r.x:= ar[i].X; |
|
345 |
r.y:= ar[i].Y; |
|
346 |
r.w:= Width; |
|
347 |
r.h:= Height; |
|
348 |
SDL_UpperBlit(Obj.Surf, nil, Surface, @r); |
|
349 |
AddRect(ar[i].x - 32, ar[i].y - 32, Width + 64, Height + 64); |
|
350 |
dec(Maxcnt) |
|
351 |
end else Maxcnt:= 0 |
|
351 | 352 |
end; |
353 |
TryPut:= Result |
|
184 | 354 |
end; |
355 |
||
356 |
procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects); |
|
357 |
var s: string; |
|
358 |
f: textfile; |
|
371 | 359 |
i, ii: LongInt; |
805 | 360 |
vobcount: Longword; |
1085
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
361 |
c1, c2: TSDL_Color; |
184 | 362 |
begin |
363 |
s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename; |
|
364 |
WriteLnToConsole('Reading objects info...'); |
|
351 | 365 |
Assign(f, s); |
184 | 366 |
{$I-} |
367 |
Reset(f); |
|
1085
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
368 |
|
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
369 |
// read sky and explosion border colors |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
370 |
Readln(f, c1.r, c1.g, c1. b); |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
371 |
Readln(f, c2.r, c2.g, c2. b); |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
372 |
|
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
373 |
glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99); // sky color |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
374 |
cExplosionBorderColor:= c2.value or $FF000000; |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
375 |
|
1097 | 376 |
ReadLn(f, s); |
377 |
if MusicFN = '' then MusicFN:= s; |
|
378 |
||
184 | 379 |
Readln(f, ThemeObjects.Count); |
380 |
for i:= 0 to Pred(ThemeObjects.Count) do |
|
381 |
begin |
|
382 |
Readln(f, s); // filename |
|
383 |
with ThemeObjects.objs[i] do |
|
384 |
begin |
|
351 | 385 |
Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true); |
386 |
Width:= Surf^.w; |
|
387 |
Height:= Surf^.h; |
|
184 | 388 |
with inland do Read(f, x, y, w, h); |
389 |
Read(f, rectcnt); |
|
390 |
for ii:= 1 to rectcnt do |
|
391 |
with outland[ii] do Read(f, x, y, w, h); |
|
392 |
Maxcnt:= 3; |
|
393 |
ReadLn(f) |
|
394 |
end; |
|
395 |
end; |
|
396 |
||
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
780
diff
changeset
|
397 |
// sprays |
184 | 398 |
Readln(f, SprayObjects.Count); |
399 |
for i:= 0 to Pred(SprayObjects.Count) do |
|
400 |
begin |
|
401 |
Readln(f, s); // filename |
|
402 |
with SprayObjects.objs[i] do |
|
403 |
begin |
|
351 | 404 |
Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true); |
405 |
Width:= Surf^.w; |
|
406 |
Height:= Surf^.h; |
|
184 | 407 |
ReadLn(f, Maxcnt) |
408 |
end; |
|
409 |
end; |
|
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
780
diff
changeset
|
410 |
|
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
780
diff
changeset
|
411 |
// snowflakes |
805 | 412 |
Readln(f, vobCount); |
413 |
if vobCount > 0 then |
|
414 |
Readln(f, vobFramesCount, vobFrameTicks, vobVelocity, vobFallSpeed); |
|
415 |
||
416 |
for i:= 0 to Pred(vobCount) do |
|
806 | 417 |
AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + 2048), random(1200) - 100, vgtFlake); |
805 | 418 |
|
351 | 419 |
Close(f); |
184 | 420 |
{$I+} |
421 |
TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true) |
|
422 |
end; |
|
423 |
||
371 | 424 |
procedure AddThemeObjects(Surface: PSDL_Surface; var ThemeObjects: TThemeObjects; MaxCount: LongInt); |
425 |
var i, ii, t: LongInt; |
|
184 | 426 |
b: boolean; |
427 |
begin |
|
428 |
if ThemeObjects.Count = 0 then exit; |
|
429 |
WriteLnToConsole('Adding theme objects...'); |
|
430 |
i:= 1; |
|
431 |
repeat |
|
432 |
t:= getrandom(ThemeObjects.Count); |
|
433 |
ii:= t; |
|
434 |
repeat |
|
435 |
inc(ii); |
|
436 |
if ii = ThemeObjects.Count then ii:= 0; |
|
437 |
b:= TryPut(ThemeObjects.objs[ii], Surface) |
|
438 |
until b or (ii = t); |
|
439 |
inc(i) |
|
440 |
until (i > MaxCount) or not b; |
|
441 |
end; |
|
442 |
||
443 |
procedure AddSprayObjects(Surface: PSDL_Surface; var SprayObjects: TSprayObjects; MaxCount: Longword); |
|
444 |
var i: Longword; |
|
371 | 445 |
ii, t: LongInt; |
184 | 446 |
b: boolean; |
447 |
begin |
|
448 |
if SprayObjects.Count = 0 then exit; |
|
449 |
WriteLnToConsole('Adding spray objects...'); |
|
450 |
i:= 1; |
|
451 |
repeat |
|
452 |
t:= getrandom(SprayObjects.Count); |
|
453 |
ii:= t; |
|
454 |
repeat |
|
455 |
inc(ii); |
|
456 |
if ii = SprayObjects.Count then ii:= 0; |
|
457 |
b:= TryPut(SprayObjects.objs[ii], Surface) |
|
458 |
until b or (ii = t); |
|
459 |
inc(i) |
|
460 |
until (i > MaxCount) or not b; |
|
461 |
end; |
|
462 |
||
463 |
procedure AddObjects(InSurface, Surface: PSDL_Surface); |
|
464 |
begin |
|
465 |
InitRects; |
|
466 |
AddGirder(256, Surface); |
|
467 |
AddGirder(512, Surface); |
|
468 |
AddGirder(768, Surface); |
|
469 |
AddGirder(1024, Surface); |
|
470 |
AddGirder(1280, Surface); |
|
471 |
AddGirder(1536, Surface); |
|
472 |
AddGirder(1792, Surface); |
|
473 |
AddThemeObjects(Surface, ThemeObjects, 8); |
|
474 |
AddProgress; |
|
475 |
SDL_UpperBlit(InSurface, nil, Surface, nil); |
|
476 |
AddSprayObjects(Surface, SprayObjects, 10); |
|
477 |
FreeRects |
|
478 |
end; |
|
479 |
||
1085
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
480 |
procedure LoadThemeConfig; |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
481 |
begin |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
482 |
ReadThemeInfo(ThemeObjects, SprayObjects) |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
483 |
end; |
0b82870073b5
Load flakes information from theme.cfg when playing painted map
unc0rr
parents:
1066
diff
changeset
|
484 |
|
184 | 485 |
end. |