hedgewars/uLandGraphics.pas
branchicegun
changeset 8587 6319accfa04a
parent 8586 191bd86ba000
child 8588 47084c6fcb4e
equal deleted inserted replaced
8586:191bd86ba000 8587:6319accfa04a
   299     if w > 255 then w:= 255;
   299     if w > 255 then w:= 255;
   300     w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask);
   300     w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask);
   301     //LandPixels[y, x]:= w;
   301     //LandPixels[y, x]:= w;
   302     LandPixels[y, x]:= addBgColor(w, c);
   302     LandPixels[y, x]:= addBgColor(w, c);
   303     LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]);
   303     LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]);
   304     Land[y, x] := land[y, x] or lfIce;            
       
   305     end
   304     end
   306 //pixel is on edge of lanscape
   305 //pixel is on edge of lanscape
   307 else if (weight < 8) then
   306 else if (weight < 8) then
   308     begin
   307     begin
   309         LandPixels[y, x] := $FFB2AF8A;                    
   308         LandPixels[y, x] := $FFB2AF8A;                    
   310         if Land[y, x] > 255 then Land[y, x] := Land[y, x] or lfIce;
       
   311     end;
   309     end;
   312 end;
   310 end;
   313 
   311 
   314 function getIncrementInquarter(dx, dy, quarter: Longint): Longint;
   312 function getIncrementInquarter(dx, dy, quarter: Longint): Longint;
   315 const directionX : array [0..3] of Longint = (0, 0, 1, -1);
   313 const directionX : array [0..3] of Longint = (0, 0, 1, -1);
   332     begin
   330     begin
   333         t:= y + getIncrementInquarter(dx, dy, q);
   331         t:= y + getIncrementInquarter(dx, dy, q);
   334         if (t and LAND_HEIGHT_MASK) = 0 then
   332         if (t and LAND_HEIGHT_MASK) = 0 then
   335             for i:= Max(x - getIncrementInquarter2(dx, dy, q), 0) to Min(x + getIncrementInquarter2(dx, dy, q), LAND_WIDTH - 1) do
   333             for i:= Max(x - getIncrementInquarter2(dx, dy, q), 0) to Min(x + getIncrementInquarter2(dx, dy, q), LAND_WIDTH - 1) do
   336                 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
   334                 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255))  then
       
   335                 begin
   337                     if (cReducedQuality and rqBlurryLand) = 0 then
   336                     if (cReducedQuality and rqBlurryLand) = 0 then
   338                        drawIcePixel(t, i)
   337                        drawIcePixel(t, i)
   339                     else
   338                     else
   340                        drawIcePixel(t div 2, i div 2) ;        
   339                        drawIcePixel(t div 2, i div 2) ;        
       
   340                     if Land[y, x] > 255 then Land[y, x] := Land[y, x] or lfIce;
       
   341                 end;
   341     end;
   342     end;
   342 end;
   343 end;
   343 
   344 
   344 procedure FillRoundInLandWithIce(X, Y, Radius: LongInt);
   345 procedure FillRoundInLandWithIce(X, Y, Radius: LongInt);
   345 var dx, dy, d: LongInt;
   346 var dx, dy, d: LongInt;