290 s: string; |
290 s: string; |
291 ThemeObjects: array[1..MAXTHEMEOBJECTS] of TThemeObject; |
291 ThemeObjects: array[1..MAXTHEMEOBJECTS] of TThemeObject; |
292 i, ii, t, n: Longword; |
292 i, ii, t, n: Longword; |
293 b: boolean; |
293 b: boolean; |
294 begin |
294 begin |
295 s:= Pathz[ptThemeCurrent] + cThemeCFGFilename; |
295 s:= Pathz[ptThemeCurrent] + '/' + cThemeCFGFilename; |
296 WriteLnToConsole('Adding objects...'); |
296 WriteLnToConsole('Adding objects...'); |
297 AssignFile(f, s); |
297 AssignFile(f, s); |
298 {$I-} |
298 {$I-} |
299 Reset(f); |
299 Reset(f); |
300 Readln(f, s); // skip color |
300 Readln(f, s); // skip color |
302 for i:= 1 to n do |
302 for i:= 1 to n do |
303 begin |
303 begin |
304 Readln(f, s); // filename |
304 Readln(f, s); // filename |
305 with ThemeObjects[i] do |
305 with ThemeObjects[i] do |
306 begin |
306 begin |
307 Surf:= LoadImage(Pathz[ptThemeCurrent] + s + '.png', false); |
307 Surf:= LoadImage(Pathz[ptThemeCurrent] + '/' + s + '.png', false); |
308 Read(f, Width, Height); |
308 Read(f, Width, Height); |
309 with inland do Read(f, x, y, w, h); |
309 with inland do Read(f, x, y, w, h); |
310 Read(f, rectcnt); |
310 Read(f, rectcnt); |
311 for ii:= 1 to rectcnt do |
311 for ii:= 1 to rectcnt do |
312 with outland[ii] do Read(f, x, y, w, h); |
312 with outland[ii] do Read(f, x, y, w, h); |
313 ReadLn(f) |
313 ReadLn(f) |
314 end; |
314 end; |
315 end; |
315 end; |
316 Closefile(f); |
316 Closefile(f); |
317 {$I+} |
317 {$I+} |
318 TryDo(IOResult = 0, 'Bad data or cannot access file', true); |
318 TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true); |
319 |
319 |
320 // loaded objects, try to put on land |
320 // loaded objects, try to put on land |
321 if n = 0 then exit; |
321 if n = 0 then exit; |
322 i:= 1; |
322 i:= 1; |
323 repeat |
323 repeat |