hedgewars/uWorld.pas
changeset 14281 e754b516cc35
parent 14225 9c5ada6431eb
child 14282 6015b74eea55
equal deleted inserted replaced
14280:3342358bc2c3 14281:e754b516cc35
  1829         begin
  1829         begin
  1830             dstX:= hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx;
  1830             dstX:= hwRound(FollowGear^.X) + hwSign(FollowGear^.dX) * z + WorldDx;
  1831 
  1831 
  1832             if (WorldEdge = weWrap) then
  1832             if (WorldEdge = weWrap) then
  1833                 begin
  1833                 begin
  1834                     if dstX - prevPoint.X < (LongInt(leftX) - rightX) div 2 then
  1834                     if dstX - prevPoint.X < (LongInt(leftX) - LongInt(rightX)) div 2 then
  1835                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (leftX - rightX)) div 8
  1835                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (leftX - rightX)) div 8
  1836                     else if dstX - prevPoint.X > (LongInt(rightX) - leftX) div 2 then
  1836                     else if dstX - prevPoint.X > (LongInt(rightX) - LongInt(leftX)) div 2 then
  1837                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (rightX - leftX)) div 8
  1837                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (rightX - leftX)) div 8
  1838                     else
  1838                     else
  1839                         CursorPoint.X:= (prevPoint.X * 7 + dstX) div 8;
  1839                         CursorPoint.X:= (prevPoint.X * 7 + dstX) div 8;
  1840                 end
  1840                 end
  1841             else // usual camera movement routine
  1841             else // usual camera movement routine
  1849             CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + hwSign(FollowGear^.dY) * z + WorldDy)) div 8;
  1849             CursorPoint.Y:= (prevPoint.Y * 7 + cScreenHeight - (hwRound(FollowGear^.Y) + hwSign(FollowGear^.dY) * z + WorldDy)) div 8;
  1850         end;
  1850         end;
  1851 
  1851 
  1852 if (WorldEdge = weWrap) then
  1852 if (WorldEdge = weWrap) then
  1853     begin
  1853     begin
  1854         if -WorldDx < leftX then
  1854         if -WorldDx < LongInt(leftX) then
  1855             WorldDx:= WorldDx - LongInt(rightX) + leftX
  1855             WorldDx:= WorldDx - LongInt(rightX) + leftX
  1856         else if -WorldDx > rightX then
  1856         else if -WorldDx > LongInt(rightX) then
  1857             WorldDx:= WorldDx + LongInt(rightX) - leftX;
  1857             WorldDx:= WorldDx + LongInt(rightX) - leftX;
  1858     end;
  1858     end;
  1859 
  1859 
  1860 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0)));
  1860 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0)));
  1861 if WorldDy < wdy then
  1861 if WorldDy < wdy then