hedgewars/uLandObjects.pas
changeset 1276 281f6aa9afba
parent 1256 2754a6a8c8f1
child 1277 752b53481057
equal deleted inserted replaced
1275:bd4048399541 1276:281f6aa9afba
   369 
   369 
   370 ReadLn(f, cCloudsNumber);
   370 ReadLn(f, cCloudsNumber);
   371 
   371 
   372 Readln(f, ThemeObjects.Count);
   372 Readln(f, ThemeObjects.Count);
   373 for i:= 0 to Pred(ThemeObjects.Count) do
   373 for i:= 0 to Pred(ThemeObjects.Count) do
   374     begin
   374 	begin
   375     Readln(f, s); // filename
   375 	Readln(f, s); // filename
   376     with ThemeObjects.objs[i] do
   376 	with ThemeObjects.objs[i] do
   377          begin
   377 			begin
   378          Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true);
   378 			Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + s, false, true, true);
   379          Width:= Surf^.w;
   379 			Width:= Surf^.w;
   380          Height:= Surf^.h;
   380 			Height:= Surf^.h;
   381          with inland do Read(f, x, y, w, h);
   381 			with inland do
   382          Read(f, rectcnt);
   382 				begin
   383          for ii:= 1 to rectcnt do
   383 				Read(f, x, y, w, h);
   384              with outland[ii] do Read(f, x, y, w, h);
   384 				TryDo((x + w <= Width) and (y + h <=Height), 'Object''s rectangle exceeds image', true)
   385          Maxcnt:= 3;
   385 				end;
   386          ReadLn(f)
   386 			Read(f, rectcnt);
   387          end;
   387 			for ii:= 1 to rectcnt do
   388     end;
   388 				with outland[ii] do
       
   389 					begin
       
   390 					Read(f, x, y, w, h);
       
   391 					TryDo((x + w <= Width) and (y + h <=Height), 'Object''s rectangle exceeds image', true);
       
   392 					end;
       
   393 			Maxcnt:= 3;
       
   394 			ReadLn(f)
       
   395 			end;
       
   396 	end;
   389 
   397 
   390 // sprays
   398 // sprays
   391 Readln(f, SprayObjects.Count);
   399 Readln(f, SprayObjects.Count);
   392 for i:= 0 to Pred(SprayObjects.Count) do
   400 for i:= 0 to Pred(SprayObjects.Count) do
   393     begin
   401     begin