hedgewars/uLandObjects.pas
changeset 5179 8d64dcb566ea
parent 5166 d1eb1560b4d5
child 5225 d38211100f4d
equal deleted inserted replaced
5178:f3cc6119f1fe 5179:8d64dcb566ea
   366 end;
   366 end;
   367 
   367 
   368 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   368 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   369 var s, key: shortstring;
   369 var s, key: shortstring;
   370     f: textfile;
   370     f: textfile;
   371     i, ii: LongInt;
   371     i: LongInt;
       
   372     ii: Longword;
   372     c1, c2: TSDL_Color;
   373     c1, c2: TSDL_Color;
   373 
   374 
   374     procedure CheckRect(Width, Height, x, y, w, h: LongWord);
   375     procedure CheckRect(Width, Height, x, y, w, h: LongWord);
   375     begin
   376     begin
   376     if (x + w > Width) then OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
   377     if (x + w > Width) then OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
   456         cSDWaterOpacity:= cWaterOpacity
   457         cSDWaterOpacity:= cWaterOpacity
   457         end
   458         end
   458     else if key = 'music' then MusicFN:= Trim(s)
   459     else if key = 'music' then MusicFN:= Trim(s)
   459     else if key = 'clouds' then
   460     else if key = 'clouds' then
   460         begin
   461         begin
   461         cCloudsNumber:= StrToInt(Trim(s)) * cScreenSpace div LAND_WIDTH;
   462         cCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH;
   462         cSDCloudsNumber:= cCloudsNumber
   463         cSDCloudsNumber:= cCloudsNumber
   463         end
   464         end
   464     else if key = 'object' then
   465     else if key = 'object' then
   465         begin
   466         begin
   466         inc(ThemeObjects.Count);
   467         inc(ThemeObjects.Count);
   572         SDWaterColorArray[2].b:= StrToInt(Trim(s));
   573         SDWaterColorArray[2].b:= StrToInt(Trim(s));
   573         SDWaterColorArray[2].a := 255;
   574         SDWaterColorArray[2].a := 255;
   574         SDWaterColorArray[3]:= SDWaterColorArray[2];
   575         SDWaterColorArray[3]:= SDWaterColorArray[2];
   575         end
   576         end
   576     else if key = 'sd-water-opacity' then cSDWaterOpacity:= StrToInt(Trim(s))
   577     else if key = 'sd-water-opacity' then cSDWaterOpacity:= StrToInt(Trim(s))
   577     else if key = 'sd-clouds' then cSDCloudsNumber:= StrToInt(Trim(s)) * cScreenSpace div LAND_WIDTH
   578     else if key = 'sd-clouds' then cSDCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH
   578     else if key = 'sd-flakes' then
   579     else if key = 'sd-flakes' then
   579         begin
   580         begin
   580         i:= Pos(',', s);
   581         i:= Pos(',', s);
   581         vobSDCount:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   582         vobSDCount:= StrToInt(Trim(Copy(s, 1, Pred(i))));
   582         Delete(s, 1, i);
   583         Delete(s, 1, i);