hedgewars/uLandTexture.pas
branchtransitional_engine
changeset 15901 f39f0f614dbf
parent 15900 128ace913837
--- a/hedgewars/uLandTexture.pas	Mon Jan 02 15:59:26 2023 +0100
+++ b/hedgewars/uLandTexture.pas	Tue Jan 03 12:05:59 2023 +0100
@@ -50,7 +50,7 @@
 var ty: Longword;
 begin
 for ty:= 0 to TEXSIZE - 1 do
-    Move(LandPixels[y * TEXSIZE + ty, x * TEXSIZE], tmpPixels[ty, 0], sizeof(Longword) * TEXSIZE);
+    Move(LandPixelRow(y * TEXSIZE + ty)^[x * TEXSIZE], tmpPixels[ty, 0], sizeof(Longword) * TEXSIZE);
 
 Pixels:= @tmpPixels
 end;
@@ -129,14 +129,14 @@
                     // first check edges
                     while isEmpty and (ty < TEXSIZE) do
                         begin
-                        isEmpty:= LandPixels[ly + ty, lx] and AMask = 0;
-                        if isEmpty then isEmpty:= LandPixels[ly + ty, Pred(lx + TEXSIZE)] and AMask = 0;
+                        isEmpty:= LandPixelGet(ly + ty, lx) and AMask = 0;
+                        if isEmpty then isEmpty:= LandPixelGet(ly + ty, Pred(lx + TEXSIZE)) and AMask = 0;
                         inc(ty)
                         end;
                     while isEmpty and (tx < TEXSIZE-1) do
                         begin
-                        isEmpty:= LandPixels[ly, lx + tx] and AMask = 0;
-                        if isEmpty then isEmpty:= LandPixels[Pred(ly + TEXSIZE), lx + tx] and AMask = 0;
+                        isEmpty:= LandPixelGet(ly, lx + tx) and AMask = 0;
+                        if isEmpty then isEmpty:= LandPixelGet(Pred(ly + TEXSIZE), lx + tx) and AMask = 0;
                         inc(tx)
                         end;
                     // then search every other remaining. does this sort of stuff defeat compiler opts?
@@ -146,7 +146,7 @@
                         tx:= 2;
                         while isEmpty and (tx < TEXSIZE-1) do
                             begin
-                            isEmpty:= LandPixels[ly + ty, lx + tx] and AMask = 0;
+                            isEmpty:= LandPixelGet(ly + ty, lx + tx) and AMask = 0;
                             inc(tx,2)
                             end;
                         inc(ty,2);
@@ -158,7 +158,7 @@
                         tx:= 1;
                         while isEmpty and (tx < TEXSIZE-1) do
                             begin
-                            isEmpty:= LandPixels[ly + ty, lx + tx] and AMask = 0;
+                            isEmpty:= LandPixelGet(ly + ty, lx + tx) and AMask = 0;
                             inc(tx,2)
                             end;
                         inc(ty,2);