PlayCinematic
(String arg)
| 1794 | * PlayCinematic |
| 1795 | */ |
| 1796 | static void PlayCinematic(String arg) { |
| 1797 | |
| 1798 | // make sure CD isn't playing music |
| 1799 | CDAudio.Stop(); |
| 1800 | |
| 1801 | ClientGlobals.cl.cinematicframe = 0; |
| 1802 | if (arg.endsWith(".pcx")) { |
| 1803 | // static pcx image |
| 1804 | String name = "pics/" + arg; |
| 1805 | int size = LoadPCX(name, ClientGlobals.cl.cinematicpalette, cin); |
| 1806 | ClientGlobals.cl.cinematicframe = -1; |
| 1807 | ClientGlobals.cl.cinematictime = 1; |
| 1808 | EndLoadingPlaque(); |
| 1809 | cls.state = ca_active; |
| 1810 | if (size == 0 || cin.pic == null) { |
| 1811 | Com.Println(name + " not found."); |
| 1812 | ClientGlobals.cl.cinematictime = 0; |
| 1813 | } |
| 1814 | return; |
| 1815 | } |
| 1816 | |
| 1817 | String name = "video/" + arg; |
| 1818 | ClientGlobals.cl.cinematic_file = FS.LoadMappedFile(name); |
| 1819 | if (ClientGlobals.cl.cinematic_file == null) { |
| 1820 | //Com.Error(ERR_DROP, "Cinematic " + name + " not found.\n"); |
| 1821 | nextServerCommand(); |
| 1822 | // done |
| 1823 | ClientGlobals.cl.cinematictime = 0; |
| 1824 | return; |
| 1825 | } |
| 1826 | |
| 1827 | EndLoadingPlaque(); |
| 1828 | |
| 1829 | cls.state = ca_active; |
| 1830 | |
| 1831 | ClientGlobals.cl.cinematic_file.order(ByteOrder.LITTLE_ENDIAN); |
| 1832 | ByteBuffer file = ClientGlobals.cl.cinematic_file; |
| 1833 | cin.width = file.getInt(); |
| 1834 | cin.height = file.getInt(); |
| 1835 | cin.s_rate = file.getInt(); |
| 1836 | cin.s_width = file.getInt(); |
| 1837 | cin.s_channels = file.getInt(); |
| 1838 | |
| 1839 | Huff1TableInit(); |
| 1840 | |
| 1841 | cin.restart_sound = true; |
| 1842 | ClientGlobals.cl.cinematicframe = 0; |
| 1843 | cin.pic = ReadNextFrame(); |
| 1844 | ClientGlobals.cl.cinematictime = Timer.Milliseconds(); |
| 1845 | } |
| 1846 | } |
no test coverage detected