hedgewars/uLand.pas
changeset 4497 08df377b4fbc
parent 4494 9585435e20f7
child 4559 194d5a7a3fd4
equal deleted inserted replaced
4488:e83216eba1db 4497:08df377b4fbc
   545                     Land[y, x]:= lfBasic
   545                     Land[y, x]:= lfBasic
   546                 else if Land[y, x] = lfBasic then
   546                 else if Land[y, x] = lfBasic then
   547                     Land[y, x]:= 0;
   547                     Land[y, x]:= 0;
   548                 end;
   548                 end;
   549         end;
   549         end;
       
   550 end;
       
   551 
       
   552 procedure GenDrawnMap;
       
   553 begin
       
   554     uLandPainted.Draw;
       
   555 
       
   556     MaxHedgehogs:= 18;
       
   557     hasGirders:= true;
       
   558     playHeight:= 2048;
       
   559     playWidth:= 4096;
       
   560     leftX:= ((LAND_WIDTH - playWidth) div 2);
       
   561     rightX:= (playWidth + ((LAND_WIDTH - playWidth) div 2)) - 1;
       
   562     topY:= LAND_HEIGHT - playHeight;
   550 end;
   563 end;
   551 
   564 
   552 function SelectTemplate: LongInt;
   565 function SelectTemplate: LongInt;
   553 begin
   566 begin
   554     if (cReducedQuality and rqLowRes) <> 0 then
   567     if (cReducedQuality and rqLowRes) <> 0 then
  1029 begin
  1042 begin
  1030     WriteLnToConsole('Generating land...');
  1043     WriteLnToConsole('Generating land...');
  1031     case cMapGen of
  1044     case cMapGen of
  1032         0: GenBlank(EdgeTemplates[SelectTemplate]);
  1045         0: GenBlank(EdgeTemplates[SelectTemplate]);
  1033         1: GenMaze;
  1046         1: GenMaze;
       
  1047         2: GenDrawnMap;
  1034     end;
  1048     end;
  1035     AddProgress();
  1049     AddProgress();
  1036 
  1050 
  1037     tmpsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, LAND_WIDTH, LAND_HEIGHT, 32, RMask, GMask, BMask, 0);
  1051     tmpsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, LAND_WIDTH, LAND_HEIGHT, 32, RMask, GMask, BMask, 0);
  1038 
  1052 
  1269 begin
  1283 begin
  1270     WriteLnToConsole('Generating preview...');
  1284     WriteLnToConsole('Generating preview...');
  1271     case cMapGen of
  1285     case cMapGen of
  1272         0: GenBlank(EdgeTemplates[SelectTemplate]);
  1286         0: GenBlank(EdgeTemplates[SelectTemplate]);
  1273         1: GenMaze;
  1287         1: GenMaze;
       
  1288         2: GenDrawnMap;
  1274     end;
  1289     end;
  1275 
  1290 
  1276     lh:= LAND_HEIGHT div 128;
  1291     lh:= LAND_HEIGHT div 128;
  1277     lw:= LAND_WIDTH div 32;
  1292     lw:= LAND_WIDTH div 32;
  1278     for y:= 0 to 127 do
  1293     for y:= 0 to 127 do