hedgewars/uLandObjects.pas
changeset 805 4d75759b38bd
parent 802 ed5450a89b96
child 806 d397c502a5dd
equal deleted inserted replaced
804:30f687f380fa 805:4d75759b38bd
    23 
    23 
    24 procedure AddObjects(InSurface, Surface: PSDL_Surface);
    24 procedure AddObjects(InSurface, Surface: PSDL_Surface);
    25 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY: Longword; Image, Surface: PSDL_Surface);
    25 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY: Longword; Image, Surface: PSDL_Surface);
    26 
    26 
    27 implementation
    27 implementation
    28 uses uLand, uStore, uConsts, uMisc, uConsole, uRandom;
    28 uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uFloat;
    29 const MaxRects = 256;
    29 const MaxRects = 256;
    30       MAXOBJECTRECTS = 16;
    30       MAXOBJECTRECTS = 16;
    31       MAXTHEMEOBJECTS = 32;
    31       MAXTHEMEOBJECTS = 32;
    32 
    32 
    33 type PRectArray = ^TRectsArray;
    33 type PRectArray = ^TRectsArray;
   351 
   351 
   352 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   352 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   353 var s: string;
   353 var s: string;
   354     f: textfile;
   354     f: textfile;
   355     i, ii: LongInt;
   355     i, ii: LongInt;
       
   356     vobcount: Longword;
   356 begin
   357 begin
   357 s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   358 s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   358 WriteLnToConsole('Reading objects info...');
   359 WriteLnToConsole('Reading objects info...');
   359 Assign(f, s);
   360 Assign(f, s);
   360 {$I-}
   361 {$I-}
   392          ReadLn(f, Maxcnt)
   393          ReadLn(f, Maxcnt)
   393          end;
   394          end;
   394     end;
   395     end;
   395 
   396 
   396 // snowflakes
   397 // snowflakes
   397 //Readln(f, );
   398 Readln(f, vobCount);
       
   399 if vobCount > 0 then
       
   400    Readln(f, vobFramesCount, vobFrameTicks, vobVelocity, vobFallSpeed);
       
   401 
       
   402 for i:= 0 to Pred(vobCount) do
       
   403     AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + 2048), random(1000), vgtFlake);
       
   404 
   398 Close(f);
   405 Close(f);
   399 {$I+}
   406 {$I+}
   400 TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true)
   407 TryDo(IOResult = 0, 'Bad data or cannot access file ' + cThemeCFGFilename, true)
   401 end;
   408 end;
   402 
   409