예제 #1
0
// kill sound stuff for game menu ---------------------------------------------
//
int AUDs_CloseMenuSound()
{
    if (SoundDisabled)
      return 1;
	
    AUDs_StopAudioStream();
	
    return 1;
}
예제 #2
0
// clear remnants of demo replay and stop demo optionally ---------------------
//
void DEMO_ClearDemo( int stopreplay )
{
	//NOTE:
	// this function has to be used after a demo containing network packets
	// has been replayed (and ended) to restore/ensure a proper game state.

	//NOTE:
	// if the network mode is not active or the net simulation has already
	// been stopped (e.g., the demo has finished) the network state will
	// be left untouched (i.e., not reset!).

	// make sure it's off
	ObjCamOff();

	// clean up network state
	if ( NetConnected ) {

		// update player status
		Player_Status[ LocalPlayerId ] = PLAYER_INACTIVE;

		// ensure no remote players
		NET_RemoveRemotePlayers();

		// remove dangling virtual packets
		NETs_FlushListenBuffers();
	}

	if ( stopreplay ) {

		// stop audio stream if started from demo
		if ( con_audio_stream_started ) {
			con_audio_stream_started = FALSE;
			AUDs_StopAudioStream();
		}

		// ensure replay stopped
		stop_from_clear_demo = TRUE;
		DEMO_StopReplay();
		stop_from_clear_demo = FALSE;

		// turn off fading
		SetScreenFade = 0;
	}

	// set proper entry-mode state
	if ( NetConnected ) {
		EntryMode		= NetJoined ? FALSE : TRUE;
		InFloatingMenu	= NetJoined ? FALSE : FloatingMenu;
	} else {
		EntryMode		= FALSE;
		InFloatingMenu	= FloatingMenu;
	}

	// reset the floating menu state
	if ( InFloatingMenu ) {
		ActivateFloatingMenu( FALSE );
	}

	// scroll demo text out
	if ( !AUX_DISABLE_CLEAR_TEXT_ON_CLEARDEMO ) {
//		HUD_ClearDemoText();
	}

	// stop local ship
	MyShip->CurSpeed = 0;

	// ensure automatic actions disabled
	REPLAY_StopAutomaticActions();

	// ensure local particle weapons are destroyed
	WFX_EnsureParticleWeaponsInactive( MyShip );

	// stop residual motion due to view camera filter
	if ( !AUX_DISABLE_CAMFILT_RESET_ON_CLEARDEMO ) {
		CAMERA_ResetFilter();
	}

	// reset mapping table for class ids
	ResetClassMapTable();

	// free objects and particles
	if ( !AUX_DISABLE_OBJECT_FREE_ON_CLEARDEMO ) {
		KillAllObjects();
	}
}