hedgewars/uLandObjects.pas
changeset 2671 7e0f88013fe8
parent 2647 0e1208e92dfe
child 2695 ed789a7ef68d
equal deleted inserted replaced
2670:1b327b7515ed 2671:7e0f88013fe8
   362 	if (x + w > Width) then OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
   362 	if (x + w > Width) then OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
   363 	if (y + h > Height) then OutError('Object''s rectangle exceeds image: y + h (' + inttostr(y) + ' + ' + inttostr(h) + ') > Height (' + inttostr(Height) + ')', true);
   363 	if (y + h > Height) then OutError('Object''s rectangle exceeds image: y + h (' + inttostr(y) + ' + ' + inttostr(h) + ') > Height (' + inttostr(Height) + ')', true);
   364 	end;
   364 	end;
   365 
   365 
   366 begin
   366 begin
       
   367 
       
   368 AddProgress;
       
   369 
   367 s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   370 s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   368 WriteLnToConsole('Reading objects info...');
   371 WriteLnToConsole('Reading objects info...');
   369 Assign(f, s);
   372 Assign(f, s);
   370 {$I-}
   373 {$I-}
   371 Reset(f);
   374 Reset(f);
   440 for i:= 0 to Pred(vobCount) do
   443 for i:= 0 to Pred(vobCount) do
   441     AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + LAND_WIDTH), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake);
   444     AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + LAND_WIDTH), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake);
   442 
   445 
   443 Close(f);
   446 Close(f);
   444 {$I+}
   447 {$I+}
   445 TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true)
   448 TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true);
       
   449 AddProgress;
   446 end;
   450 end;
   447 
   451 
   448 procedure AddThemeObjects(var ThemeObjects: TThemeObjects; MaxCount: LongInt);
   452 procedure AddThemeObjects(var ThemeObjects: TThemeObjects; MaxCount: LongInt);
   449 var i, ii, t: LongInt;
   453 var i, ii, t: LongInt;
   450     b: boolean;
   454     b: boolean;