Пример #1
0
/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void
Host_Shutdown(void)
{
    static qboolean isdown = false;

    if (isdown) {
	printf("recursive shutdown\n");
	return;
    }
    isdown = true;

// keep Con_Printf from trying to update the screen
    scr_disabled_for_loading = true;

    Host_WriteConfiguration();

    CDAudio_Shutdown();
    NET_Shutdown();
    BGM_Shutdown();
    S_Shutdown();
    IN_Shutdown();

    if (cls.state != ca_dedicated) {
	VID_Shutdown();
    }
}
Пример #2
0
/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void Host_Shutdown(void)
{
	static qboolean isdown = false;

	if (isdown)
	{
		Con_Print("recursive shutdown\n");
		return;
	}
	if (setjmp(host_abortframe))
	{
		Con_Print("aborted the quitting frame?!?\n");
		return;
	}
	isdown = true;

	// be quiet while shutting down
	S_StopAllSounds();

	// disconnect client from server if active
	CL_Disconnect();

	// shut down local server if active
	Host_ShutdownServer ();

	// Shutdown menu
	if(MR_Shutdown)
		MR_Shutdown();

	// AK shutdown PRVM
	// AK hmm, no PRVM_Shutdown(); yet

	CL_Gecko_Shutdown();
	CL_Video_Shutdown();

	Host_SaveConfig();

	CDAudio_Shutdown ();
	S_Terminate ();
	Curl_Shutdown ();
	NetConn_Shutdown ();
	//PR_Shutdown ();

	if (cls.state != ca_dedicated)
	{
		R_Modules_Shutdown();
		VID_Shutdown();
		Thread_Shutdown();
	}

	Cmd_Shutdown();
	Key_Shutdown();
	CL_Shutdown();
	Sys_Shutdown();
	Log_Close();
	Crypto_Shutdown();
	FS_Shutdown();
	Con_Shutdown();
	Memory_Shutdown();
}
Пример #3
0
void Host_Shutdown(void) {
    static bool isdown = false;

    if (isdown) {
        printf("recursive shutdown\n");
        return;
    }
    isdown = true;

    // keep Con_Printf from trying to update the screen
    scr_disabled_for_loading = true;

    Host_WriteConfiguration();

    CDAudio_Shutdown();
    NET_Shutdown();
    S_Shutdown();
    IN_Shutdown();
    NN_deinit();

    TextureManager::clearAllTextures();
    Alias::shutdown();
    Cmd::shutdown();
    CVar::shutdown();
    MemoryObj::Flush(MemoryObj::ZONE);

    if (cls.state != ca_dedicated) {
        VID_Shutdown();
    }
    if (con_debuglog) {
        Con_CloseDebugLog();
    }
}
Пример #4
0
void
CL_Shutdown(void)
{
	static qboolean isdown = false;

	if (isdown)
	{
		printf("recursive shutdown\n");
		return;
	}

	isdown = true;

	CL_WriteConfiguration();

	Key_WriteConsoleHistory();

#ifdef CDA
	CDAudio_Shutdown();
#endif
#ifdef OGG
	OGG_Stop();
#endif
	S_Shutdown();
	IN_Shutdown();
	VID_Shutdown();
}
Пример #5
0
/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void Host_Shutdown(void)
{
	static qboolean isdown = false;

	if (isdown)
	{
		printf ("recursive shutdown\n");
		return;
	}
	isdown = true;

// keep Con_Printf from trying to update the screen
	scr_disabled_for_loading = true;

	Host_WriteConfiguration ();
#ifdef PROQUAKE_EXTENSION
	IPLog_WriteLog ();	// JPG 1.05 - ip loggging
#endif
	if (con_initialized)
		History_Shutdown ();

	CDAudio_Shutdown ();
	NET_Shutdown ();
	S_Shutdown();
	IN_Shutdown ();

	if (cls.state != ca_dedicated)
	{
		VID_Shutdown();
	}
}
Пример #6
0
void CDA_Shutdown (void)
{
#ifdef UQE_FMOD_CDAUDIO

	//if(SND_InitialisedCD == false)
		//return;

	if (fmod_musicCD_subsound)
		FMOD_Sound_Release(fmod_musicCD_subsound);

	if (fmod_musicCD)
		FMOD_Sound_Release(fmod_musicCD);

#else
	CDAudio_Shutdown ();
#endif
}
Пример #7
0
/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void Host_Shutdown(void)
{
    static qboolean isdown = false;

    if (isdown) {
	printf("recursive shutdown\n");
	return;
    }
    isdown = true;

    Host_WriteConfiguration();

    CDAudio_Shutdown();
    NET_Shutdown();
    S_Shutdown();
    IN_Shutdown();
    if (host_basepal)
	VID_Shutdown();
}
Пример #8
0
static void CD_f (void)
{
	const char *command;
#ifdef MAXTRACKS
	int ret;
	int n;
#endif

	command = Cmd_Argv (1);

	if (strcasecmp(command, "remap") != 0)
		Host_StartVideo();

	if (strcasecmp(command, "on") == 0)
	{
		enabled = true;
		return;
	}

	if (strcasecmp(command, "off") == 0)
	{
		CDAudio_Stop();
		enabled = false;
		return;
	}

	if (strcasecmp(command, "reset") == 0)
	{
		enabled = true;
		CDAudio_Stop();
#ifdef MAXTRACKS
		for (n = 0; n < MAXTRACKS; n++)
			*remap[n] = 0; // empty string, that is, unremapped
#endif
		CDAudio_GetAudioDiskInfo();
		return;
	}

	if (strcasecmp(command, "rescan") == 0)
	{
		CDAudio_Shutdown();
		CDAudio_Startup();
		return;
	}

	if (strcasecmp(command, "remap") == 0)
	{
#ifdef MAXTRACKS
		ret = Cmd_Argc() - 2;
		if (ret <= 0)
		{
			for (n = 1; n < MAXTRACKS; n++)
				if (*remap[n])
					Con_Printf("  %u -> %s\n", n, remap[n]);
			return;
		}
		for (n = 1; n <= ret; n++)
			strlcpy(remap[n], Cmd_Argv (n+1), sizeof(*remap));
#endif
		return;
	}

	if (strcasecmp(command, "close") == 0)
	{
		CDAudio_CloseDoor();
		return;
	}

	if (strcasecmp(command, "play") == 0)
	{
		if (music_playlist_index.integer >= 0)
			return;
		CDAudio_Play_byName(Cmd_Argv (2), false, true, 0);
		return;
	}

	if (strcasecmp(command, "loop") == 0)
	{
		if (music_playlist_index.integer >= 0)
			return;
		CDAudio_Play_byName(Cmd_Argv (2), true, true, 0);
		return;
	}

	if (strcasecmp(command, "stop") == 0)
	{
		if (music_playlist_index.integer >= 0)
			return;
		CDAudio_Stop();
		return;
	}

	if (strcasecmp(command, "pause") == 0)
	{
		if (music_playlist_index.integer >= 0)
			return;
		CDAudio_Pause();
		return;
	}

	if (strcasecmp(command, "resume") == 0)
	{
		if (music_playlist_index.integer >= 0)
			return;
		CDAudio_Resume();
		return;
	}

	if (strcasecmp(command, "eject") == 0)
	{
		if (faketrack == -1)
			CDAudio_Stop();
		CDAudio_Eject();
		cdValid = false;
		return;
	}

	if (strcasecmp(command, "info") == 0)
	{
		CDAudio_GetAudioDiskInfo ();
		if (cdValid)
			Con_Printf("%u tracks on CD.\n", maxTrack);
		else
			Con_Print ("No CD in player.\n");
		if (cdPlaying)
			Con_Printf("Currently %s track %u\n", cdPlayLooping ? "looping" : "playing", cdPlayTrack);
		else if (wasPlaying)
			Con_Printf("Paused %s track %u\n", cdPlayLooping ? "looping" : "playing", cdPlayTrack);
		if (cdvolume >= 0)
			Con_Printf("Volume is %f\n", cdvolume);
		else
			Con_Printf("Can't get CD volume\n");
		return;
	}

	Con_Printf("CD commands:\n");
	Con_Printf("cd on - enables CD audio system\n");
	Con_Printf("cd off - stops and disables CD audio system\n");
	Con_Printf("cd reset - resets CD audio system (clears track remapping and re-reads disc information)\n");
	Con_Printf("cd rescan - rescans disks in drives (to use another disc)\n");
	Con_Printf("cd remap <remap1> [remap2] [remap3] [...] - chooses (possibly emulated) CD tracks to play when a map asks for a particular track, this has many uses\n");
	Con_Printf("cd close - closes CD tray\n");
	Con_Printf("cd eject - stops playing music and opens CD tray to allow you to change disc\n");
	Con_Printf("cd play <tracknumber> - plays selected track in remapping table\n");
	Con_Printf("cd loop <tracknumber> - plays and repeats selected track in remapping table\n");
	Con_Printf("cd stop - stops playing current CD track\n");
	Con_Printf("cd pause - pauses CD playback\n");
	Con_Printf("cd resume - unpauses CD playback\n");
	Con_Printf("cd info - prints basic disc information (number of tracks, currently playing track, volume level)\n");
}
Пример #9
0
/*
===============
Host_Shutdown

FIXME: this is a callback from Sys_Quit and Sys_Error.  It would be better
to run quit through here before the final handoff to the sys code.
===============
*/
void Host_Shutdown(void)
{
	static qboolean isdown = false;

	if (isdown)
	{
		Con_Print("recursive shutdown\n");
		return;
	}
	if (setjmp(host_abortframe))
	{
		Con_Print("aborted the quitting frame?!?\n");
		return;
	}
	isdown = true;

	// be quiet while shutting down
	S_StopAllSounds();

	// end the server thread
	if (svs.threaded)
		SV_StopThread();

	// disconnect client from server if active
	CL_Disconnect();

	// shut down local server if active
	SV_LockThreadMutex();
	Host_ShutdownServer ();
	SV_UnlockThreadMutex();

#ifdef CONFIG_MENU
	// Shutdown menu
	if(MR_Shutdown)
		MR_Shutdown();
#endif

	// AK shutdown PRVM
	// AK hmm, no PRVM_Shutdown(); yet

	CL_Video_Shutdown();

    IRC_Shutdown();
	Host_SaveConfig();

#ifdef CONFIG_CD
	CDAudio_Shutdown ();
#endif
	S_Terminate ();
	Curl_Shutdown ();
	NetConn_Shutdown ();
	//PR_Shutdown ();

	if (cls.state != ca_dedicated)
	{
		R_Modules_Shutdown();
		VID_Shutdown();
	}

	SV_StopThread();
	Thread_Shutdown();
	Cmd_Shutdown();
	Key_Shutdown();
	CL_Shutdown();
	Sys_Shutdown();
	Log_Close();
	Crypto_Shutdown();

	Host_UnlockSession();

	S_Shutdown();
	Con_Shutdown();
	Memory_Shutdown();
}
Пример #10
0
static void CD_f (void)
{
    char	*command;
    int		ret;
    int		n;

    if (Cmd_Argc() < 2)
    {
        Con_Printf("CD parameters:\n on\n off\n reset\n remap\n eject\n close\n play\n loop\n pause\n resume\n stop\n info\n"); // Manoel Kasimier
        return;
    }

    command = Cmd_Argv (1);

    if (Q_strcasecmp(command, "on") == 0)
    {
        Cvar_SetValue("cd_enabled", 1); // Manoel Kasimier - CD player in menu
        return;
    }

    if (Q_strcasecmp(command, "off") == 0)
    {
        if (playing)
            CDAudio_Stop();
        Cvar_SetValue("cd_enabled", 0); // Manoel Kasimier - CD player in menu
        return;
    }

    if (Q_strcasecmp(command, "reset") == 0)
    {
        /* // Manoel Kasimier - Windows XP fix
        if (playing)
        	CDAudio_Stop();
        for (n = 0; n < 100; n++)
        	remap[n] = n;
        CDAudio_GetAudioDiskInfo();
        */ // Manoel Kasimier - Windows XP fix - begin
        CDAudio_Shutdown();
        CDAudio_Init();
        // Manoel Kasimier - Windows XP fix - end
        return;
    }

    if (Q_strcasecmp(command, "remap") == 0)
    {
        ret = Cmd_Argc() - 2;
        if (ret <= 0)
        {
            for (n = 1; n < 100; n++)
                if (remap[n] != n)
                    Con_Printf("  %u -> %u\n", n, remap[n]);
            return;
        }
        for (n = 1; n <= ret; n++)
            remap[n] = Q_atoi(Cmd_Argv (n+1));
        return;
    }

    // Manoel Kasimier - moved the "eject" command here so empty drives can be ejected
    if (Q_strcasecmp(command, "eject") == 0)
    {
        if (playing)
            CDAudio_Stop();
        CDAudio_Eject();
        cdValid = false;
        maxTrack = 0; // Manoel Kasimier - CD player in menu
        return;
    }

    if (Q_strcasecmp(command, "close") == 0)
    {
        CDAudio_CloseDoor();
        Cbuf_AddText ("wait;cd reset\n", "cd reset"); // Manoel Kasimier - CD player in menu - auto-update CD status after closing drive door
        return;
    }

    if (Q_strcasecmp(command, "info") == 0)
    {
        // Manoel Kasimier - begin
        if (!maxTrack)
            Con_Printf("No CD in player.\n");
        else
        {
            Con_Printf("%u tracks\n", maxTrack);
            if (!cdValid)
                Con_Printf("No audio tracks on disc\n");
            else // List valid tracks
            {
                Con_Printf("Audio tracks on disc:\n");
                for (n=1; n<=99; n++)
                    if (audioTrack[n])
                    {
                        if (!audioTrack[n+1]) // end of sequence, or isolated track
                            Con_Printf(" %2i\n", n);
                        else if (!audioTrack[n-1]) // beginning of sequence
                            Con_Printf(" %2i -", n);
                    }
                if (cd_enabled.value)
                {
                    // Manoel Kasimier - end
                    if (playing)
                        Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
                    else if (wasPlaying)
                        Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
                    // Manoel Kasimier - begin
                }
            }
        }
        if (!cd_enabled.value)
            Con_Printf("CD audio is off\n");
        // Manoel Kasimier - end
        Con_Printf("Volume is %.1f\n", cdvolume); // Manoel Kasimier - edited
        return;
    }

    if (!cdValid)
    {
        CDAudio_GetAudioDiskInfo();
        if (!cdValid)
        {
            // Manoel Kasimier - begin
            if (maxTrack)
                Con_Printf("No audio tracks on disc\n");
            else
                // Manoel Kasimier - end
                Con_Printf("No CD in player.\n");
            return;
        }
    }

    if (Q_strcasecmp(command, "play") == 0)
    {
        CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), false);
        return;
    }

    if (Q_strcasecmp(command, "loop") == 0)
    {
        CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), true);
        return;
    }

    if (Q_strcasecmp(command, "stop") == 0)
    {
        CDAudio_Stop();
        return;
    }

    if (Q_strcasecmp(command, "pause") == 0)
    {
        CDAudio_Pause();
        return;
    }

    if (Q_strcasecmp(command, "resume") == 0)
    {
        CDAudio_Resume();
        return;
    }

    Con_Printf("CD parameters:\n on\n off\n reset\n remap\n eject\n close\n play\n loop\n pause\n resume\n stop\n info\n"); // Manoel Kasimier - absent/unrecognized parameter
}