Separate setting and drawing ice icegun
authorUrbertar@gmail.com
Tue, 26 Feb 2013 17:04:40 +0200
branchicegun
changeset 8587 6319accfa04a
parent 8586 191bd86ba000
child 8588 47084c6fcb4e
Separate setting and drawing ice
hedgewars/uLandGraphics.pas
--- a/hedgewars/uLandGraphics.pas	Tue Feb 26 16:46:58 2013 +0200
+++ b/hedgewars/uLandGraphics.pas	Tue Feb 26 17:04:40 2013 +0200
@@ -301,13 +301,11 @@
     //LandPixels[y, x]:= w;
     LandPixels[y, x]:= addBgColor(w, c);
     LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]);
-    Land[y, x] := land[y, x] or lfIce;            
     end
 //pixel is on edge of lanscape
 else if (weight < 8) then
     begin
         LandPixels[y, x] := $FFB2AF8A;                    
-        if Land[y, x] > 255 then Land[y, x] := Land[y, x] or lfIce;
     end;
 end;
 
@@ -334,10 +332,13 @@
         if (t and LAND_HEIGHT_MASK) = 0 then
             for i:= Max(x - getIncrementInquarter2(dx, dy, q), 0) to Min(x + getIncrementInquarter2(dx, dy, q), LAND_WIDTH - 1) do
                 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
+                begin
                     if (cReducedQuality and rqBlurryLand) = 0 then
                        drawIcePixel(t, i)
                     else
                        drawIcePixel(t div 2, i div 2) ;        
+                    if Land[y, x] > 255 then Land[y, x] := Land[y, x] or lfIce;
+                end;
     end;
 end;