hedgewars/uWorld.pas
changeset 15593 f0ac916a0608
parent 15459 b9b48e8b5ec4
child 15650 85d2afe34116
equal deleted inserted replaced
15592:46b7b2c821d0 15593:f0ac916a0608
   875             inc(i, lw)
   875             inc(i, lw)
   876             end
   876             end
   877     end
   877     end
   878 end;
   878 end;
   879 
   879 
       
   880 // Force the lower camera boundary to never be lower than a few pixels below the water line
       
   881 function LowerCameraBound: LongInt;
       
   882 begin
       
   883 LowerCameraBound:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0)));
       
   884 if WorldDy < LowerCameraBound then
       
   885     WorldDy:= LowerCameraBound;
       
   886 end;
   880 
   887 
   881 procedure DrawWorld(Lag: LongInt);
   888 procedure DrawWorld(Lag: LongInt);
   882 begin
   889 begin
   883     if ZoomValue < zoom then
   890     if ZoomValue < zoom then
   884     begin
   891     begin
   895         end
   902         end
   896     else
   903     else
   897         ZoomValue:= zoom;
   904         ZoomValue:= zoom;
   898 
   905 
   899     if (not isPaused) and (not isAFK) and (GameType <> gmtRecord) then
   906     if (not isPaused) and (not isAFK) and (GameType <> gmtRecord) then
   900         MoveCamera;
   907         MoveCamera
       
   908     else if (isPaused) then
       
   909         LowerCameraBound;
   901 
   910 
   902     if cStereoMode = smNone then
   911     if cStereoMode = smNone then
   903         begin
   912         begin
   904         RenderClear();
   913         RenderClear();
   905         DrawWorldStereo(Lag, rmDefault)
   914         DrawWorldStereo(Lag, rmDefault)
  1939             WorldDx:= WorldDx - rightX + leftX
  1948             WorldDx:= WorldDx - rightX + leftX
  1940         else if -WorldDx > rightX then
  1949         else if -WorldDx > rightX then
  1941             WorldDx:= WorldDx + rightX - leftX;
  1950             WorldDx:= WorldDx + rightX - leftX;
  1942     end;
  1951     end;
  1943 
  1952 
  1944 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + trunc(CinematicBarH / (cScaleFactor / 2.0)));
  1953 wdy:= LowerCameraBound;
  1945 if WorldDy < wdy then
       
  1946     WorldDy:= wdy;
       
  1947 
  1954 
  1948 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1955 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1949     exit;
  1956     exit;
  1950 
  1957 
  1951 if (AMState = AMShowingUp) or (AMState = AMShowing) then
  1958 if (AMState = AMShowingUp) or (AMState = AMShowing) then