hedgewars/GSHandlers.inc
changeset 4642 d9e7d173e6a7
parent 4641 43d17e3b81de
child 4655 b75bb4307b0f
equal deleted inserted replaced
4641:43d17e3b81de 4642:d9e7d173e6a7
   558         end
   558         end
   559 end;
   559 end;
   560 
   560 
   561 procedure doStepSnowflake(Gear: PGear);
   561 procedure doStepSnowflake(Gear: PGear);
   562 var xx, yy, px, py, i: LongInt;
   562 var xx, yy, px, py, i: LongInt;
   563     move: Boolean;
   563     move, allpx: Boolean;
   564     s: PSDL_Surface;
   564     s: PSDL_Surface;
   565     p: PLongwordArray;
   565     p: PLongwordArray;
   566 begin
   566 begin
   567 if GameTicks and $7 = 0 then
   567 if GameTicks and $7 = 0 then
   568     begin
   568     begin
   599             else i:= 1;
   599             else i:= 1;
   600             if (yy > 0) and ((Land[yy-1, xx] and $FF00) = 0) then dec(yy)
   600             if (yy > 0) and ((Land[yy-1, xx] and $FF00) = 0) then dec(yy)
   601             else dec(xx, i);
   601             else dec(xx, i);
   602             dec(yy,2);
   602             dec(yy,2);
   603             dec(xx,i);
   603             dec(xx,i);
   604             if (((cReducedQuality and rqBlurryLand) = 0) and 
   604             s:= SpritesData[sprSnow].Surface;
   605                     (xx >= 0) and (xx < LAND_WIDTH-4) and (yy >= 0) and (yy < LAND_HEIGHT)) or
   605             p:= s^.pixels;
   606                (((cReducedQuality and rqBlurryLand) <> 0) and
   606             allpx:= true;
   607                     (xx >= 0) and (xx < (LAND_WIDTH div 2)-4) and (yy >= 0) and (yy < LAND_HEIGHT div 2)) then
   607             for py:= 0 to Pred(s^.h) do
   608                 begin
   608                 begin
   609                 s:= SpritesData[sprSnow].Surface;
   609                 for px:= 0 to Pred(s^.w) do
   610                 p:= s^.pixels;
   610                     if ((yy + py and LAND_HEIGHT_MASK) = 0) and ((xx + px and LAND_WIDTH_MASK) = 0) and 
   611 
   611                        ((Land[yy + py, xx + px] and $FF00) = 0) then
   612                 for py:= 0 to Pred(s^.h) do
   612                         begin
   613                     begin
   613                         if (cReducedQuality and rqBlurryLand) = 0 then
   614                     for px:= 0 to Pred(s^.w) do
   614                             LandPixels[yy + py, xx + px]:= p^[px]
   615                         if (Land[yy + py, xx + px] and $FF00) = 0 then
   615                         else
   616                             begin
   616                             LandPixels[(yy + py) div 2, (xx + px) div 2]:= p^[px]
   617                             if (cReducedQuality and rqBlurryLand) = 0 then
   617                         end
   618                                 LandPixels[yy + py, xx + px]:= p^[px]
   618                     else allpx:= false;
   619                             else
   619                 p:= @(p^[s^.pitch shr 2])
   620                                 LandPixels[(yy + py) div 2, (xx + px) div 2]:= p^[px]
       
   621                             end;
       
   622                     p:= @(p^[s^.pitch shr 2])
       
   623                     end;
       
   624                 UpdateLandTexture(xx, 4, yy, 4)
       
   625                 end;
   620                 end;
       
   621             if allpx then UpdateLandTexture(xx, 4, yy, 4)
       
   622             else UpdateLandTexture(xx, 1, yy, 1);
   626             inc(yy,2);
   623             inc(yy,2);
   627             inc(xx,i);
   624             inc(xx,i);
   628             if ((xx and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx]:= Land[yy, xx] or lfObject;
   625             if ((xx and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx]:= Land[yy, xx] or lfObject;
   629             if yy > 0 then
   626             if yy > 0 then
   630                 begin 
   627                 begin