hedgewars/uWorld.pas
branch0.9.16
changeset 5995 647d52370ce9
parent 5862 b4229b0abc70
child 6131 4e8816cf9459
--- a/hedgewars/uWorld.pas	Mon Sep 19 19:12:19 2011 +0200
+++ b/hedgewars/uWorld.pas	Sun Sep 25 10:48:18 2011 -0400
@@ -31,7 +31,7 @@
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
 procedure HideMission;
-procedure ShakeCamera(amount: LongWord);
+procedure ShakeCamera(amount: LongInt);
 procedure InitCameraBorders;
 procedure MoveCamera;
 procedure onFocusStateChanged;
@@ -54,7 +54,8 @@
     uRender,
     uCaptions,
     uCursor,
-    uCommands
+    uCommands,
+    uMobile
     ;
 
 var cWaveWidth, cWaveHeight: LongInt;
@@ -914,11 +915,11 @@
 DrawCaptions;
 
 // Teams Healths
-if TeamsCount * 20 > cScreenHeight div 7 then  // take up less screen on small displays
+if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
     begin
     SetScale(1.5);
     smallScreenOffset:= cScreenHeight div 6;
-    if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$80);
+    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$80);
     end
 else smallScreenOffset:= 0;
 for t:= 0 to Pred(TeamsCount) do
@@ -957,7 +958,7 @@
       // this approach should be faster than drawing all borders one by one tinted or not
       if highlight then
          begin
-         if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$80)
+         if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$80)
          else Tint($FF, $FF, $FF, $FF);
 
          // draw name
@@ -979,7 +980,7 @@
 if smallScreenOffset <> 0 then
     begin
     SetScale(cDefaultZoomLevel);
-    if TeamsCount * 20 > cScreenHeight div 5 then Tint($FF,$FF,$FF,$FF);
+    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$FF);
     end;
 
 // Lag alert
@@ -1196,7 +1197,10 @@
     else
     begin
         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx) div 8;
-        CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y)+ hwSign(FollowGear^.dY) * z + WorldDy)) div 8;
+        if isPhone() 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;
     end;
 
 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;
@@ -1312,7 +1316,7 @@
     if missionTex <> nil then FreeTexture(missionTex);
 end;
 
-procedure ShakeCamera(amount: LongWord);
+procedure ShakeCamera(amount: LongInt);
 begin
     if isCursorVisible then exit;
     amount:= Max(1, round(amount*zoom/2));