RunCinematic
()
| 1718 | * RunCinematic |
| 1719 | */ |
| 1720 | static void RunCinematic() { |
| 1721 | if (ClientGlobals.cl.cinematictime <= 0) { |
| 1722 | StopCinematic(); |
| 1723 | return; |
| 1724 | } |
| 1725 | |
| 1726 | if (ClientGlobals.cl.cinematicframe == -1) { |
| 1727 | // static image |
| 1728 | return; |
| 1729 | } |
| 1730 | |
| 1731 | if (cls.key_dest != key_game) { |
| 1732 | // pause if menu or console is up |
| 1733 | ClientGlobals.cl.cinematictime = cls.realtime - ClientGlobals.cl.cinematicframe * 1000 / 14; |
| 1734 | return; |
| 1735 | } |
| 1736 | |
| 1737 | int frame = (int) ((cls.realtime - ClientGlobals.cl.cinematictime) * 14.0f / 1000); |
| 1738 | |
| 1739 | if (frame <= ClientGlobals.cl.cinematicframe) |
| 1740 | return; |
| 1741 | |
| 1742 | if (frame > ClientGlobals.cl.cinematicframe + 1) { |
| 1743 | Com.Println("Dropped frame: " + frame + " > " |
| 1744 | + (ClientGlobals.cl.cinematicframe + 1)); |
| 1745 | ClientGlobals.cl.cinematictime = cls.realtime - ClientGlobals.cl.cinematicframe * 1000 / 14; |
| 1746 | } |
| 1747 | |
| 1748 | cin.pic = cin.pic_pending; |
| 1749 | cin.pic_pending = ReadNextFrame(); |
| 1750 | |
| 1751 | if (cin.pic_pending == null) { |
| 1752 | StopCinematic(); |
| 1753 | nextServerCommand(); |
| 1754 | // hack to get the black screen behind loading |
| 1755 | ClientGlobals.cl.cinematictime = 1; |
| 1756 | BeginLoadingPlaque(); |
| 1757 | ClientGlobals.cl.cinematictime = 0; |
| 1758 | return; |
| 1759 | } |
| 1760 | } |
| 1761 | |
| 1762 | /** |
| 1763 | * DrawCinematic |
no test coverage detected