hedgewars/uWorld.pas
changeset 10662 e0d7d499c851
parent 10634 35d059bd0932
child 10672 c2004c3e9c7d
equal deleted inserted replaced
10661:0da243c01bde 10662:e0d7d499c851
  1865         prevPoint:= CursorPoint;
  1865         prevPoint:= CursorPoint;
  1866         exit
  1866         exit
  1867         end
  1867         end
  1868     else
  1868     else
  1869         begin
  1869         begin
  1870         if abs(prevPoint.X - WorldDx - hwRound(FollowGear^.X)) > LongInt(rightX) - leftX - 100 then
  1870         if (WorldEdge = weWrap) then
       
  1871             cameraJump:= LongInt(playWidth) div 2 + 50
       
  1872         else
       
  1873             cameraJump:= LongInt(rightX) - leftX - 100;
       
  1874 
       
  1875         if abs(prevPoint.X - WorldDx - hwRound(FollowGear^.X)) > cameraJump then
  1871             begin
  1876             begin
  1872             if (prevPoint.X - WorldDx) * 2 < LongInt((rightX + leftX)) then
  1877             if prevPoint.X - WorldDx < LongInt(playWidth div 2) then
  1873                 cameraJump:= LongInt(rightX) - leftX
  1878                 cameraJump:= LongInt(playWidth)
  1874                 else
  1879             else
  1875                 cameraJump:= LongInt(leftX) - rightX;
  1880                 cameraJump:= -LongInt(playWidth);
  1876             WorldDx:= WorldDx - cameraJump;
  1881             WorldDx:= WorldDx - cameraJump;
  1877             end;
  1882             end;
  1878 
  1883 
  1879         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx) div 8;
  1884         CursorPoint.X:= (prevPoint.X * 7 + hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx) div 8;
  1880 
  1885