hedgewars/uLand.pas
changeset 7556 4617e8ec0507
parent 7483 d479b98d38f7
child 7561 5f0b1829b16f
--- a/hedgewars/uLand.pas	Sat Aug 18 01:20:29 2012 +0200
+++ b/hedgewars/uLand.pas	Sat Aug 18 13:21:37 2012 +0200
@@ -127,7 +127,7 @@
     SDL_FreeSurface(tmpsurf);
 end;
 
-procedure SetPoints(var Template: TEdgeTemplate; var pa: TPixAr);
+procedure SetPoints(var Template: TEdgeTemplate; var pa: TPixAr; fps: PPointArray);
 var i: LongInt;
 begin
 with Template do
@@ -148,7 +148,7 @@
                if pa.ar[i].x <> NTPX then
                    pa.ar[i].x:= LAND_WIDTH - 1 - pa.ar[i].x;
             for i:= 0 to pred(FillPointsCount) do
-                FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
+                fps^[i].x:= LAND_WIDTH - 1 - fps^[i].x;
             end;
 
 (*  Experiment in making this option more useful
@@ -181,9 +181,9 @@
             end;
         for i:= 0 to pred(FillPointsCount) do
             begin
-            dec(FillPoints^[i].y, 100);
-            if FillPoints^[i].y < 0 then
-                FillPoints^[i].y:= 0;
+            dec(fps^[i].y, 100);
+            if fps^[i].y < 0 then
+                fps^[i].y:= 0;
             end;
         end;
 
@@ -192,7 +192,7 @@
         for i:= 0 to pred(BasePointsCount) do
             pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
         for i:= 0 to pred(FillPointsCount) do
-            FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y;
+            fps^[i].y:= LAND_HEIGHT - 1 - fps^[i].y;
         end;
     end
 end;
@@ -202,13 +202,15 @@
 var pa: TPixAr;
     i: Longword;
     y, x: Longword;
+	fps: TPointArray;
 begin
+	fps:=Template.FillPoints^;
     ResizeLand(Template.TemplateWidth, Template.TemplateHeight);
     for y:= 0 to LAND_HEIGHT - 1 do
         for x:= 0 to LAND_WIDTH - 1 do
             Land[y, x]:= lfBasic;
     {$HINTS OFF}
-    SetPoints(Template, pa);
+    SetPoints(Template, pa, @fps);
     {$HINTS ON}
     for i:= 1 to Template.BezierizeCount do
         begin
@@ -225,7 +227,7 @@
 
     with Template do
         for i:= 0 to pred(FillPointsCount) do
-            with FillPoints^[i] do
+            with fps[i] do
                 FillLand(x, y);
 
     DrawEdge(pa, lfBasic);