hedgewars/uLandObjects.pas
branchhedgeroid
changeset 6328 d14adf1c7721
parent 6305 5f7480c2a08d
child 6453 11c578d30bd3
equal deleted inserted replaced
6236:1998ff75321a 6328:d14adf1c7721
   390     end;
   390     end;
   391 
   391 
   392 begin
   392 begin
   393 
   393 
   394 AddProgress;
   394 AddProgress;
       
   395 // Set default water greyscale values
       
   396 if cGrayScale then
       
   397     begin
       
   398     for i:= 0 to 3 do
       
   399         begin
       
   400         t:= round(SDWaterColorArray[i].r * RGB_LUMINANCE_RED + SDWaterColorArray[i].g * RGB_LUMINANCE_GREEN + SDWaterColorArray[i].b * RGB_LUMINANCE_BLUE);
       
   401         if t > 255 then t:= 255;
       
   402         SDWaterColorArray[i].r:= t;
       
   403         SDWaterColorArray[i].g:= t;
       
   404         SDWaterColorArray[i].b:= t
       
   405         end;
       
   406     for i:= 0 to 1 do
       
   407         begin
       
   408         t:= round(WaterColorArray[i].r * RGB_LUMINANCE_RED + WaterColorArray[i].g * RGB_LUMINANCE_GREEN + WaterColorArray[i].b * RGB_LUMINANCE_BLUE);
       
   409         if t > 255 then t:= 255;
       
   410         WaterColorArray[i].r:= t;
       
   411         WaterColorArray[i].g:= t;
       
   412         WaterColorArray[i].b:= t
       
   413         end
       
   414     end;
   395 
   415 
   396 s:= UserPathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   416 s:= UserPathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   397 if not FileExists(s) then s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   417 if not FileExists(s) then s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   398 WriteLnToConsole('Reading objects info...');
   418 WriteLnToConsole('Reading objects info...');
   399 Assign(f, s);
   419 Assign(f, s);
   443         Delete(s, 1, i);
   463         Delete(s, 1, i);
   444         i:= Pos(',', s);
   464         i:= Pos(',', s);
   445         c2.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   465         c2.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   446         Delete(s, 1, i);
   466         Delete(s, 1, i);
   447         c2.b:= StrToInt(Trim(s));
   467         c2.b:= StrToInt(Trim(s));
       
   468         if cGrayScale then
       
   469             begin
       
   470             t:= round(SkyColor.r * RGB_LUMINANCE_RED + SkyColor.g * RGB_LUMINANCE_GREEN + SkyColor.b * RGB_LUMINANCE_BLUE);
       
   471             if t > 255 then t:= 255;
       
   472             c2.r:= t;
       
   473             c2.g:= t;
       
   474             c2.b:= t
       
   475             end;
   448         cExplosionBorderColor:= c2.value or AMask;
   476         cExplosionBorderColor:= c2.value or AMask;
   449         end
   477         end
   450     else if key = 'water-top' then
   478     else if key = 'water-top' then
   451         begin
   479         begin
   452         i:= Pos(',', s);
   480         i:= Pos(',', s);
   586             vobVelocity:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   614             vobVelocity:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   587             Delete(s, 1, i);
   615             Delete(s, 1, i);
   588             vobFallSpeed:= StrToInt(Trim(s));
   616             vobFallSpeed:= StrToInt(Trim(s));
   589             end;
   617             end;
   590         end
   618         end
       
   619     else if key = 'flatten-flakes' then cFlattenFlakes:= true
       
   620     else if key = 'flatten-clouds' then cFlattenClouds:= true
   591     else if key = 'sd-water-top' then
   621     else if key = 'sd-water-top' then
   592         begin
   622         begin
   593         i:= Pos(',', s);
   623         i:= Pos(',', s);
   594         SDWaterColorArray[0].r:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   624         SDWaterColorArray[0].r:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   595         Delete(s, 1, i);
   625         Delete(s, 1, i);