hedgewars/uWorld.pas
changeset 70 82d93eeecebe
parent 69 d8a526934b9f
child 71 5f56c6979496
equal deleted inserted replaced
69:d8a526934b9f 70:82d93eeecebe
   316       begin
   316       begin
   317       FollowGear:= nil;
   317       FollowGear:= nil;
   318       exit
   318       exit
   319       end
   319       end
   320       else begin
   320       else begin
   321       CursorPoint.x:= (CursorPoint.x + (round(FollowGear.X + Sign(FollowGear.dX) * 100) + WorldDx)) div 2;
   321       CursorPoint.x:= (CursorPoint.x * 3 + (round(FollowGear.X + Sign(FollowGear.dX) * 100) + WorldDx)) div 4;
   322       CursorPoint.y:= (CursorPoint.y + (round(FollowGear.Y) + WorldDy)) div 2
   322       CursorPoint.y:= (CursorPoint.y * 3 + (round(FollowGear.Y) + WorldDy)) div 4
   323       end;
   323       end;
   324 
   324 
   325 if ((CursorPoint.X = prevPoint.X)and(CursorPoint.Y = prevpoint.Y)) then exit;
   325 if ((CursorPoint.X = prevPoint.X)and(CursorPoint.Y = prevpoint.Y)) then exit;
   326 
   326 
   327 if isCursorVisible then
   327 if isCursorVisible then
   358          WorldDy:= WorldDy - CursorPoint.Y + cScreenHeight - cScreenEdgesDist;
   358          WorldDy:= WorldDy - CursorPoint.Y + cScreenHeight - cScreenEdgesDist;
   359          CursorPoint.Y:= cScreenHeight - cScreenEdgesDist
   359          CursorPoint.Y:= cScreenHeight - cScreenEdgesDist
   360          end;
   360          end;
   361    end else
   361    end else
   362    begin
   362    begin
   363       WorldDx:= WorldDx - CursorPoint.X + (cScreenWidth  shr 1);
   363       WorldDx:= WorldDx - CursorPoint.X + prevPoint.X;
   364       WorldDy:= WorldDy - CursorPoint.Y + (cScreenHeight shr 1);
   364       WorldDy:= WorldDy - CursorPoint.Y + prevPoint.Y;
   365       CursorPoint.X:= (cScreenWidth  shr 1);
   365       CursorPoint.X:= (cScreenWidth  shr 1);
   366       CursorPoint.Y:= (cScreenHeight shr 1);
   366       CursorPoint.Y:= (cScreenHeight shr 1);
   367    end;
   367    end;
   368 SDL_WarpMouse(CursorPoint.X, CursorPoint.Y);
   368 SDL_WarpMouse(CursorPoint.X, CursorPoint.Y);
   369 prevPoint:= CursorPoint;
   369 prevPoint:= CursorPoint;