hedgewars/uWorld.pas
branchhedgeroid
changeset 6224 42b256eca362
parent 6023 a28be05b20bc
parent 6135 2172330ad52a
child 6328 d14adf1c7721
--- a/hedgewars/uWorld.pas	Fri Oct 28 17:41:39 2011 +0200
+++ b/hedgewars/uWorld.pas	Fri Oct 28 18:26:17 2011 +0200
@@ -536,7 +536,7 @@
 var i, w, h, lw, lh, rw, rh, sw: LongInt;
 begin
     sw:= round(cScreenWidth / cScaleFactor);
-    if ((SpritesData[sprL].Texture = nil) or (SpritesData[sprR].Texture = nil)) and (SpritesData[spr].Texture <> nil) then
+    if (SpritesData[sprL].Texture = nil) and (SpritesData[spr].Texture <> nil) then
         begin
         w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
         h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
@@ -554,8 +554,11 @@
         h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
         lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale;
         lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale;
-        rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
-        rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale;
+        if SpritesData[sprR].Texture <> nil then
+            begin
+            rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
+            rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale
+            end;
         dec(Shift, w div 2);
         DrawTexture(Shift, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
 
@@ -567,11 +570,18 @@
             end;
 
         i:= Shift + w;
-        while i <= sw do
-            begin
-            DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
-            inc(i, rw)
-            end
+        if SpritesData[sprR].Texture <> nil then
+            while i <= sw do
+                begin
+                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
+                inc(i, rw)
+                end
+        else
+            while i <= sw do
+                begin
+                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale);
+                inc(i, lw)
+                end
         end
 end;
 
@@ -1201,7 +1211,7 @@
     else
     begin
         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx) div 8;
-        if isPhone() then
+        if isPhone() or (cScreenHeight < 600) or ((hwSign(FollowGear^.dY) * z) < 10)  then
             CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + WorldDy)) div 8
         else
             CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + hwSign(FollowGear^.dY) * z + WorldDy)) div 8;