hedgewars/uWorld.pas
changeset 11519 aab4767d9a50
parent 11362 ed5a6478e710
child 11520 663ecfb05df6
equal deleted inserted replaced
11518:02a13be714d2 11519:aab4767d9a50
  1380 RenderWorldEdge();
  1380 RenderWorldEdge();
  1381 
  1381 
  1382 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1382 // this scale is used to keep the various widgets at the same dimension at all zoom levels
  1383 SetScale(cDefaultZoomLevel);
  1383 SetScale(cDefaultZoomLevel);
  1384 
  1384 
       
  1385 // cinematic effects
       
  1386 if InCinematicMode
       
  1387     and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven
       
  1388     or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo)) then
       
  1389     begin
       
  1390     inc(CinematicSteps, Lag);
       
  1391     if CinematicSteps > 300 then
       
  1392         CinematicSteps:= 300;
       
  1393     end
       
  1394 else if CinematicSteps > 0 then
       
  1395     begin
       
  1396     dec(CinematicSteps, Lag);
       
  1397     if CinematicSteps < 0 then
       
  1398         CinematicSteps:= 0;
       
  1399     end;
       
  1400 
       
  1401 // render black bars
       
  1402 if CinematicSteps > 0 then
       
  1403     begin
       
  1404     r.x:= ViewLeftX;
       
  1405     r.w:= ViewWidth;
       
  1406     r.y:= ViewTopY;
       
  1407     CinematicBarH:= (ViewHeight * CinematicSteps) div 2048;
       
  1408     r.h:= CinematicBarH;
       
  1409     DrawRect(r, 0, 0, 0, $FF, true);
       
  1410     r.y:= ViewBottomY - r.h;
       
  1411     DrawRect(r, 0, 0, 0, $FF, true);
       
  1412     end;
       
  1413 
       
  1414 
  1385 // Turn time
  1415 // Turn time
  1386 if UIDisplay <> uiNone then
  1416 if UIDisplay <> uiNone then
  1387     begin
  1417     begin
  1388 {$IFDEF USE_TOUCH_INTERFACE}
  1418 {$IFDEF USE_TOUCH_INTERFACE}
  1389     offsetX:= cScreenHeight - 13;
  1419     offsetX:= cScreenHeight - 13;
  1749             WorldDx:= WorldDx - LongInt(rightX) + leftX
  1779             WorldDx:= WorldDx - LongInt(rightX) + leftX
  1750         else if -WorldDx > rightX then
  1780         else if -WorldDx > rightX then
  1751             WorldDx:= WorldDx + LongInt(rightX) - leftX;
  1781             WorldDx:= WorldDx + LongInt(rightX) - leftX;
  1752     end;
  1782     end;
  1753 
  1783 
  1754 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;
  1784 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - (cVisibleWater + CinematicBarH);
  1755 if WorldDy < wdy then
  1785 if WorldDy < wdy then
  1756     WorldDy:= wdy;
  1786     WorldDy:= wdy;
  1757 
  1787 
  1758 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1788 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1759     exit;
  1789     exit;