hedgewars/uWorld.pas
changeset 11522 17bd1c25670a
parent 11520 663ecfb05df6
child 11524 c6bae7605ea4
equal deleted inserted replaced
11521:dc36fad455f4 11522:17bd1c25670a
  1385 // cinematic effects
  1385 // cinematic effects
  1386 if CinematicScript or (InCinematicMode
  1386 if CinematicScript or (InCinematicMode
  1387     and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven
  1387     and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven
  1388     or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo))) then
  1388     or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo))) then
  1389     begin
  1389     begin
  1390     inc(CinematicSteps, Lag);
  1390     if CinematicSteps < 300 then
  1391     if CinematicSteps > 300 then
  1391         begin
       
  1392         inc(CinematicSteps, Lag);
       
  1393         if CinematicSteps > 300 then
  1392         CinematicSteps:= 300;
  1394         CinematicSteps:= 300;
       
  1395         CinematicBarH:= (ViewHeight * CinematicSteps) div 2048;
       
  1396         end;
  1393     end
  1397     end
  1394 else if CinematicSteps > 0 then
  1398 else if CinematicSteps > 0 then
  1395     begin
  1399     begin
  1396     dec(CinematicSteps, Lag);
  1400     dec(CinematicSteps, Lag);
  1397     if CinematicSteps < 0 then
  1401     if CinematicSteps < 0 then
  1398         CinematicSteps:= 0;
  1402         CinematicSteps:= 0;
       
  1403     CinematicBarH:= (ViewHeight * CinematicSteps) div 2048;
  1399     end;
  1404     end;
  1400 
  1405 
  1401 // render black bars
  1406 // render black bars
  1402 if CinematicSteps > 0 then
  1407 if CinematicSteps > 0 then
  1403     begin
  1408     begin
  1404     r.x:= ViewLeftX;
  1409     r.x:= ViewLeftX;
  1405     r.w:= ViewWidth;
  1410     r.w:= ViewWidth;
  1406     r.y:= ViewTopY;
  1411     r.y:= ViewTopY;
  1407     CinematicBarH:= (ViewHeight * CinematicSteps) div 2048;
       
  1408     r.h:= CinematicBarH;
  1412     r.h:= CinematicBarH;
  1409     DrawRect(r, 0, 0, 0, $FF, true);
  1413     DrawRect(r, 0, 0, 0, $FF, true);
  1410     r.y:= ViewBottomY - r.h;
  1414     r.y:= ViewBottomY - r.h;
  1411     DrawRect(r, 0, 0, 0, $FF, true);
  1415     DrawRect(r, 0, 0, 0, $FF, true);
  1412     end;
  1416     end;