hedgewars/uLand.pas
changeset 109 ab0340f580c2
parent 107 b08ce0293a51
child 155 401f4ea24715
equal deleted inserted replaced
108:08f1fe6f21f8 109:ab0340f580c2
   227          _dir:= dir
   227          _dir:= dir
   228          end
   228          end
   229     end;
   229     end;
   230 
   230 
   231 var xl, xr, dir: integer;
   231 var xl, xr, dir: integer;
   232 begin
   232 begin     
   233 Stack.Count:= 0;
   233 Stack.Count:= 0;
   234 xl:= x - 1;
   234 xl:= x - 1;
   235 xr:= x;
   235 xr:= x;
   236 Push(xl, xr, y, -1);
   236 Push(xl, xr, y, -1);
   237 Push(xl, xr, y,  1);
   237 Push(xl, xr, y,  1);
   460      end;
   460      end;
   461 end;
   461 end;
   462 
   462 
   463 procedure GenLandSurface;
   463 procedure GenLandSurface;
   464 var tmpsurf: PSDL_Surface;
   464 var tmpsurf: PSDL_Surface;
   465     i: Longword;
   465     y, x: Longword;
   466 begin
   466 begin
   467 WriteLnToConsole('Generating land...');
   467 WriteLnToConsole('Generating land...');
   468 for i:= 0 to sizeof(Land) div 4 do
   468 for y:= 0 to 1023 do
   469     PLongword(Longword(@Land) + i * 4)^:= COLOR_LAND;
   469     for x:= 0 to 2047 do
       
   470         Land[y, x]:= COLOR_LAND;
   470 GenBlank(EdgeTemplates[getrandom(Succ(High(EdgeTemplates)))]);
   471 GenBlank(EdgeTemplates[getrandom(Succ(High(EdgeTemplates)))]);
   471 
   472 
   472 AddProgress;
   473 AddProgress;
   473 with PixelFormat^ do
   474 with PixelFormat^ do
   474      tmpsurf:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0);
   475      tmpsurf:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0);