Move map view also when we have no window focus
authorunc0rr
Mon, 17 Dec 2007 19:14:42 +0000
changeset 678 5cf90dbcb309
parent 677 9d0bcc3c903a
child 679 8187912107ac
Move map view also when we have no window focus
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Mon Dec 17 18:05:58 2007 +0000
+++ b/hedgewars/uWorld.pas	Mon Dec 17 19:14:42 2007 +0000
@@ -391,7 +391,9 @@
 const PrevSentPointTime: LongWord = 0;
 var EdgesDist: LongInt;
 begin
-if not (CurrentTeam^.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
+if (not (CurrentTeam^.ExtDriven and isCursorVisible))
+   and cHasFocus then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
+
 if (FollowGear <> nil) then
    if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then
       begin
@@ -399,8 +401,8 @@
       exit
       end
       else begin
-      CursorPoint.x:= (CursorPoint.x * 7 + (hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100) + WorldDx) div 8;
-      CursorPoint.y:= (CursorPoint.y * 7 + (hwRound(FollowGear^.Y) + WorldDy)) div 8
+      CursorPoint.x:= (prevPoint.x * 7 + (hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * 100) + WorldDx) div 8;
+      CursorPoint.y:= (prevPoint.y * 7 + (hwRound(FollowGear^.Y) + WorldDy)) div 8
       end;
 
 if ((CursorPoint.X = prevPoint.X)and(CursorPoint.Y = prevpoint.Y)) then exit;