# HG changeset patch # User koda # Date 1277151533 -7200 # Node ID c4e0ef1641621cd8a45f943d0d597eba0f83b0e3 # Parent 1d7b056ff8663a8cf72f24fbe6cb96f3cbcc4a31# Parent 96a502730e81a635cedc6817185ae029242fa6c0 merge diff -r 1d7b056ff866 -r c4e0ef164162 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Sun Jun 20 23:05:11 2010 +0200 +++ b/hedgewars/uLandGraphics.pas Mon Jun 21 22:18:53 2010 +0200 @@ -644,7 +644,7 @@ function Despeckle(X, Y: LongInt): boolean; var nx, ny, i, j, c: LongInt; begin -if (Land[Y, X] > 255) and ((Land[Y, X] and lfIndestructible) = 0) and ((Land[Y, X] and lfDamaged) <> 0)then // check neighbours +if ((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0) then // check neighbours begin c:= 0; for i:= -1 to 1 do diff -r 1d7b056ff866 -r c4e0ef164162 hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Sun Jun 20 23:05:11 2010 +0200 +++ b/hedgewars/uLandObjects.pas Mon Jun 21 22:18:53 2010 +0200 @@ -211,23 +211,27 @@ end; function CheckLand(rect: TSDL_Rect; dX, dY, Color: Longword): boolean; -var i: LongInt; +var i, tmpx, tmpy, bx, by: LongInt; bRes: boolean = true; begin inc(rect.x, dX); inc(rect.y, dY); +bx:= rect.x + rect.w; +by:= rect.y + rect.h; i:= 0; {$WARNINGS OFF} -while (i <= rect.w) and bRes do +tmpx:= rect.x; +while (tmpx <= bx) and bRes do begin - bRes:= (Land[rect.y, rect.x + i] = Color) and (Land[rect.y + rect.h, rect.x + i] = Color); - inc(i) + bRes:= (Land[rect.y, tmpx] = Color) and (Land[by, tmpx] = Color); + inc(tmpx) end; i:= 0; -while (i <= rect.h) and bRes do +tmpy:= rect.y; +while (tmpy <= by) and bRes do begin - bRes:= (Land[rect.y + i, rect.x] = Color) and (Land[rect.y + i, rect.x + rect.w] = Color); - inc(i) + bRes:= (Land[tmpy, rect.x] = Color) and (Land[tmpy, bx] = Color); + inc(tmpy) end; {$WARNINGS ON} CheckLand:= bRes;