hedgewars/uLandGraphics.pas
changeset 2331 e4941a7986d6
parent 2236 af8fc3311748
child 2376 ece7b87f1334
--- a/hedgewars/uLandGraphics.pas	Mon Aug 24 22:57:59 2009 +0000
+++ b/hedgewars/uLandGraphics.pas	Tue Aug 25 20:54:11 2009 +0000
@@ -28,6 +28,7 @@
 
 function SweepDirty: boolean;
 function Despeckle(X, Y: LongInt): boolean;
+function CheckLandValue(X, Y: LongInt; Color: Word): boolean;
 procedure DrawExplosion(X, Y, Radius: LongInt);
 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte);
 procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt);
@@ -477,4 +478,9 @@
 SweepDirty:= Result
 end;
 
+// Return true if outside of land or not the value tested, used right now for some X/Y movement that does not use normal hedgehog movement in GSHandlers.inc
+function CheckLandValue(X, Y: LongInt; Color: Word): boolean;
+begin
+     CheckLandValue:= ((X and LAND_WIDTH_MASK <> 0) or (Y and LAND_HEIGHT_MASK <> 0)) or (Land[Y, X] <> Color)
+end;
 end.