/* * SCR_PlayCinematic */ static void SCR_PlayCinematic( const char *arg, int flags ) { struct cinematics_s *cin; CL_SoundModule_Clear(); cin = CIN_Open( arg, 0, qfalse, qtrue ); if( !cin ) { Com_Printf( "SCR_PlayCinematic: couldn't find %s\n", arg ); return; } CL_Disconnect( NULL ); cl.cin.h = cin; cl.cin.keepRatio = (flags & 1) ? qfalse : qtrue; cl.cin.allowConsole = (flags & 2) ? qfalse : qtrue; cl.cin.paused = qfalse; cl.cin.absStartTime = cl.cin.absCurrentTime = cl.cin.absPrevTime = SCR_CinematicTime(); cl.cin.currentTime = 0; CL_SetClientState( CA_CINEMATIC ); CL_SoundModule_StopAllSounds(); SCR_EndLoadingPlaque(); SCR_ReadNextCinematicFrame(); }
/* * SCR_PauseCinematic */ void SCR_PauseCinematic( void ) { if( cls.state != CA_CINEMATIC ) { return; } cl.cin.paused = !cl.cin.paused; if( cl.cin.paused ) { CL_SoundModule_Clear(); } }
/* * SCR_PauseCinematic */ void SCR_PauseCinematic( bool pause ) { if( cls.state != CA_CINEMATIC ) { return; } cl.cin.pause_cnt += pause ? 1 : -1; if( cl.cin.pause_cnt == 1 && pause ) { cl.cin.pauseTime = SCR_CinematicTime(); CL_SoundModule_LockBackgroundTrack( true ); CL_SoundModule_Clear(); } else if( cl.cin.pause_cnt == 0 && !pause ) { cl.cin.startTime += SCR_CinematicTime() - cl.cin.pauseTime; cl.cin.pauseTime = 0; CL_SoundModule_LockBackgroundTrack( false ); } if( cl.cin.pause_cnt < 0 ) { cl.cin.pause_cnt = 0; } }