hedgewars/uLandGraphics.pas
changeset 188 a7c2a61524c2
parent 184 f97a7a3dc8f6
child 196 993cf173218b
equal deleted inserted replaced
187:96c3154efee5 188:a7c2a61524c2
   159 if SDL_MustLock(LandSurface) then
   159 if SDL_MustLock(LandSurface) then
   160    SDL_LockSurface(LandSurface);
   160    SDL_LockSurface(LandSurface);
   161 
   161 
   162 for i:= 0 to Pred(Count) do
   162 for i:= 0 to Pred(Count) do
   163     begin
   163     begin
   164     for ty:= max(-Radius, -y) to min(Radius, 1023 - y) do
   164     for ty:= max(y - Radius, 0) to min(y + Radius, 1023) do
   165         for tx:= max(0, ar[i].Left - Radius) to min(2047, ar[i].Right + Radius) do
   165         for tx:= max(0, ar[i].Left - Radius) to min(2047, ar[i].Right + Radius) do
   166             ClearLandPixel(y + ty, tx);
   166             ClearLandPixel(ty, tx);
   167     inc(y, dY)
   167     inc(y, dY)
   168     end;
   168     end;
   169 
   169 
   170 inc(Radius, 4);
   170 inc(Radius, 4);
   171 dec(y, Count*dY);
   171 dec(y, Count*dY);
   172 
   172 
   173 for i:= 0 to Pred(Count) do
   173 for i:= 0 to Pred(Count) do
   174     begin
   174     begin
   175     for ty:= max(-Radius, -y) to min(Radius, 1023 - y) do
   175     for ty:= max(y - Radius, 0) to min(y + Radius, 1023) do
   176         for tx:= max(0, ar[i].Left - Radius) to min(2047, ar[i].Right + Radius) do
   176         for tx:= max(0, ar[i].Left - Radius) to min(2047, ar[i].Right + Radius) do
   177             if Land[y + ty, tx] = $FFFFFF then
   177             if Land[ty, tx] = $FFFFFF then
   178                   SetLandPixel(y + ty, tx);
   178                   SetLandPixel(ty, tx);
   179     inc(y, dY)
   179     inc(y, dY)
   180     end;
   180     end;
   181 
   181 
   182 if SDL_MustLock(LandSurface) then
   182 if SDL_MustLock(LandSurface) then
   183    SDL_UnlockSurface(LandSurface);
   183    SDL_UnlockSurface(LandSurface);