hedgewars/uLandObjects.pas
changeset 80 3c3dc6a148ca
parent 74 42257fee61ae
child 107 b08ce0293a51
equal deleted inserted replaced
79:29b477319854 80:3c3dc6a148ca
   362 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   362 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
   363 var s: string;
   363 var s: string;
   364     f: textfile;
   364     f: textfile;
   365     i, ii: integer;
   365     i, ii: integer;
   366 begin
   366 begin
   367 s:= Pathz[ptThemeCurrent] + '/' + cThemeCFGFilename;
   367 s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
   368 WriteLnToConsole('Reading objects info...');
   368 WriteLnToConsole('Reading objects info...');
   369 AssignFile(f, s);
   369 AssignFile(f, s);
   370 {$I-}
   370 {$I-}
   371 Reset(f);
   371 Reset(f);
   372 Readln(f, s); // skip color
   372 Readln(f, s); // skip color
   374 for i:= 0 to Pred(ThemeObjects.Count) do
   374 for i:= 0 to Pred(ThemeObjects.Count) do
   375     begin
   375     begin
   376     Readln(f, s); // filename
   376     Readln(f, s); // filename
   377     with ThemeObjects.objs[i] do
   377     with ThemeObjects.objs[i] do
   378          begin
   378          begin
   379          Surf:= LoadImage(Pathz[ptThemeCurrent] + '/' + s, false);
   379          Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false);
   380          Read(f, Width, Height);
   380          Read(f, Width, Height);
   381          with inland do Read(f, x, y, w, h);
   381          with inland do Read(f, x, y, w, h);
   382          Read(f, rectcnt);
   382          Read(f, rectcnt);
   383          for ii:= 1 to rectcnt do
   383          for ii:= 1 to rectcnt do
   384              with outland[ii] do Read(f, x, y, w, h);
   384              with outland[ii] do Read(f, x, y, w, h);
   391 for i:= 0 to Pred(SprayObjects.Count) do
   391 for i:= 0 to Pred(SprayObjects.Count) do
   392     begin
   392     begin
   393     Readln(f, s); // filename
   393     Readln(f, s); // filename
   394     with SprayObjects.objs[i] do
   394     with SprayObjects.objs[i] do
   395          begin
   395          begin
   396          Surf:= LoadImage(Pathz[ptThemeCurrent] + '/' + s, false);
   396          Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false);
   397          Width:= Surf.w;
   397          Width:= Surf.w;
   398          Height:= Surf.h;
   398          Height:= Surf.h;
   399          ReadLn(f, Maxcnt)
   399          ReadLn(f, Maxcnt)
   400          end;
   400          end;
   401     end;
   401     end;