hedgewars/uLandGraphics.pas
changeset 10138 1a71d28392cb
parent 10131 4b4a043111f4
child 10152 15e9bb6fcab2
equal deleted inserted replaced
10137:a4537aab4117 10138:1a71d28392cb
   618 p:= PByteArray(@(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]));
   618 p:= PByteArray(@(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]));
   619 case bpp of
   619 case bpp of
   620     4: for y:= 0 to Pred(h) do
   620     4: for y:= 0 to Pred(h) do
   621         begin
   621         begin
   622         for x:= 0 to Pred(w) do
   622         for x:= 0 to Pred(w) do
   623             if (PLongword(@(p^[x * 4]))^) <> 0 then
   623             if ((PLongword(@(p^[x * 4]))^) and AMask) <> 0 then
   624                 if ((cpY + y) <= Longint(topY)) or ((cpY + y) >= LAND_HEIGHT) or
   624                 if ((cpY + y) <= Longint(topY)) or ((cpY + y) >= LAND_HEIGHT) or
   625                    ((cpX + x) <= Longint(leftX)) or ((cpX + x) >= Longint(rightX)) or (Land[cpY + y, cpX + x] <> 0) then
   625                    ((cpX + x) <= Longint(leftX)) or ((cpX + x) >= Longint(rightX)) or (Land[cpY + y, cpX + x] <> 0) then
   626                     begin
   626                     begin
   627                         if SDL_MustLock(Image) then
   627                         if SDL_MustLock(Image) then
   628                             SDL_UnlockSurface(Image);
   628                             SDL_UnlockSurface(Image);
   644 p:= PByteArray(@(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]));
   644 p:= PByteArray(@(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]));
   645 case bpp of
   645 case bpp of
   646     4: for y:= 0 to Pred(h) do
   646     4: for y:= 0 to Pred(h) do
   647         begin
   647         begin
   648         for x:= 0 to Pred(w) do
   648         for x:= 0 to Pred(w) do
   649             if (PLongword(@(p^[x * 4]))^) <> 0 then
   649             if ((PLongword(@(p^[x * 4]))^) and AMask) <> 0 then
   650                    begin
   650                    begin
   651                 if (cReducedQuality and rqBlurryLand) = 0 then
   651                 if (cReducedQuality and rqBlurryLand) = 0 then
   652                     begin
   652                     begin
   653                     gX:= cpX + x;
   653                     gX:= cpX + x;
   654                     gY:= cpY + y;
   654                     gY:= cpY + y;