hedgewars/uLandGraphics.pas
changeset 7268 3a61c53346a8
parent 7170 84ac6c6d2d8e
child 7270 93e92e82d5c8
--- a/hedgewars/uLandGraphics.pas	Fri Jun 22 08:13:51 2012 +0400
+++ b/hedgewars/uLandGraphics.pas	Sat Jun 23 22:44:11 2012 +0400
@@ -40,6 +40,7 @@
 function  LandBackPixel(x, y: LongInt): LongWord;
 procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
+procedure DumpLandToLog(x, y, r: LongInt);
 
 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
 
@@ -1157,4 +1158,28 @@
         DrawLines(x1, y1, x2, y2, dx, dy, color);
 end;
 
+
+procedure DumpLandToLog(x, y, r: LongInt);
+var xx, yy, dx: LongInt;
+    s: shortstring;
+begin
+    s[0]:= char(r * 2 + 1);
+    for yy:= y - r to y + r do
+        begin
+        for dx:= 0 to r*2 do
+            begin
+            xx:= dx - r + x;
+            if (xx = x) and (yy = y) then
+                s[dx + 1]:= 'X'
+            else if Land[yy, xx] > 255 then
+                s[dx + 1]:= 'O'
+            else if Land[yy, xx] > 0 then
+                s[dx + 1]:= '*'
+            else
+                s[dx + 1]:= '.'
+            end;
+        AddFileLog('Land dump: ' + s);
+        end;
+end;
+
 end.