hedgewars/uLand.pas
changeset 3595 341e407e3754
parent 3551 d4de36b3801a
child 3598 a8aa06bae895
equal deleted inserted replaced
3594:aeca3d8f1b29 3595:341e407e3754
   641 
   641 
   642 p:= Surface^.pixels;
   642 p:= Surface^.pixels;
   643 for y:= 0 to LAND_HEIGHT - 1 do
   643 for y:= 0 to LAND_HEIGHT - 1 do
   644     begin
   644     begin
   645     for x:= 0 to LAND_WIDTH - 1 do
   645     for x:= 0 to LAND_WIDTH - 1 do
   646 {$IFDEF DOWNSCALE}
   646         if (cReducedQuality and rqBlurryLand) = 0 then
   647         if Land[y, x] <> 0 then LandPixels[y div 2, x div 2]:= p^[x] or AMask;
   647             if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or AMask
   648 {$ELSE}
   648         else
   649         if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or AMask;
   649             if Land[y, x] <> 0 then LandPixels[y div 2, x div 2]:= p^[x] or AMask;
   650 {$ENDIF}
       
   651 
   650 
   652     p:= @(p^[Surface^.pitch div 4]);
   651     p:= @(p^[Surface^.pitch div 4]);
   653     end;
   652     end;
   654 
   653 
   655 if SDL_MustLock(Surface) then
   654 if SDL_MustLock(Surface) then
  1263     // also try basing cave dimensions on map/template dimensions, if they exist
  1262     // also try basing cave dimensions on map/template dimensions, if they exist
  1264     for w:= 0 to 5 do // width of 3 allowed hogs to be knocked through with grenade
  1263     for w:= 0 to 5 do // width of 3 allowed hogs to be knocked through with grenade
  1265         begin
  1264         begin
  1266         for y:= topY to LAND_HEIGHT - 1 do
  1265         for y:= topY to LAND_HEIGHT - 1 do
  1267             begin
  1266             begin
  1268             Land[y, leftX + w]:= lfIndestructible;
  1267                 Land[y, leftX + w]:= lfIndestructible;
  1269             Land[y, rightX - w]:= lfIndestructible;
  1268                 Land[y, rightX - w]:= lfIndestructible;
  1270             if (y + w) mod 32 < 16 then
  1269                 if (y + w) mod 32 < 16 then
  1271                 c:= AMask
  1270                     c:= AMask
  1272             else
  1271                 else
  1273                 c:= AMask or RMask or GMask; // FF00FFFF
  1272                     c:= AMask or RMask or GMask; // FF00FFFF
  1274 {$IFDEF DOWNSCALE}
  1273 
  1275             LandPixels[y div 2, (leftX + w) div 2]:= c;
  1274                 if (cReducedQuality and rqBlurryLand) = 0 then
  1276             LandPixels[y div 2, (rightX - w) div 2]:= c;
  1275                 begin
  1277 {$ELSE}
  1276                     LandPixels[y, leftX + w]:= c;
  1278             LandPixels[y, leftX + w]:= c;
  1277                     LandPixels[y, rightX - w]:= c;
  1279             LandPixels[y, rightX - w]:= c;
  1278                 end
  1280 {$ENDIF}
  1279                 else
       
  1280                 begin
       
  1281                     LandPixels[y div 2, (leftX + w) div 2]:= c;
       
  1282                     LandPixels[y div 2, (rightX - w) div 2]:= c;
       
  1283                 end;
  1281             end;
  1284             end;
  1282 
  1285 
  1283         for x:= leftX to rightX do
  1286         for x:= leftX to rightX do
  1284             begin
  1287             begin
  1285             Land[topY + w, x]:= lfIndestructible;
  1288                 Land[topY + w, x]:= lfIndestructible;
  1286             if (x + w) mod 32 < 16 then
  1289                 if (x + w) mod 32 < 16 then
  1287                 c:= AMask
  1290                     c:= AMask
  1288             else
  1291                 else
  1289                 c:= AMask or RMask or GMask; // FF00FFFF
  1292                     c:= AMask or RMask or GMask; // FF00FFFF
  1290 {$IFDEF DOWNSCALE}
  1293 
  1291             LandPixels[(topY + w) div 2, x div 2]:= c;
  1294                 if (cReducedQuality and rqBlurryLand) = 0 then
  1292 {$ELSE}
  1295                     LandPixels[topY + w, x]:= c
  1293             LandPixels[topY + w, x]:= c;
  1296                 else
  1294 {$ENDIF}
  1297                     LandPixels[(topY + w) div 2, x div 2]:= c;
  1295             end;
  1298             end;
  1296         end;
  1299         end;
  1297     end;
  1300     end;
  1298 
  1301 
  1299 if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false;
  1302 if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false;