diff -r 5b2b86a37089 -r a28be05b20bc hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Sep 25 18:22:12 2011 +0200 +++ b/hedgewars/uWorld.pas Sun Sep 25 18:24:01 2011 +0200 @@ -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; @@ -918,11 +919,11 @@ DrawTexture(Round(-cScreenWidth*0.5 + cScreenHeight*0.02),Round((cScreenHeight*0.98)-(spritesData[sprFireButton].Height*0.4) ),spritesData[sprFireButton].Texture, 0.4); {$ENDIF} // 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 @@ -961,7 +962,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 @@ -983,7 +984,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 @@ -1200,7 +1201,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; @@ -1316,7 +1320,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));