示例#1
0
文件: host.c 项目: libretro/tyrquake
/*
===============
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)
	{
		printf ("recursive shutdown\n");
		return;
	}
	isdown = true;

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

	Host_WriteConfiguration (); 

	// jkrige - fmod sound system (music)
	//CDAudio_Shutdown ();
	// jkrige - fmod sound system (music)

	NET_Shutdown ();

	// jkrige - fmod sound system (system)
	FMOD_Shutdown();
	// jkrige - fmod sound system (system)

	S_Shutdown();
	IN_Shutdown ();

	if (cls.state != ca_dedicated)
	{
		VID_Shutdown();
	}
}
示例#3
0
文件: host.cpp 项目: DrLabman/QMB
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();
    }
}
/*
===============
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();
	}
}
示例#5
0
文件: host.c 项目: indev/asquake
/*
===============
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();
}
示例#6
0
/*
==================
Host_Game_f
==================
*/
void Host_Game_f (void)
{
	int i;
	unsigned int path_id;
	searchpath_t *search = com_searchpaths;
	pack_t *pak;
	char   pakfile[MAX_OSPATH]; //FIXME: it's confusing to use this string for two different things

	if (Cmd_Argc() > 1)
	{
		if (!registered.value) //disable command for shareware quake
		{
			Con_Printf("You must have the registered version to use modified games\n");
			return;
		}

		if (strstr(Cmd_Argv(1), ".."))
		{
			Con_Printf ("Relative pathnames are not allowed.\n");
			return;
		}

		q_strlcpy (pakfile, va("%s/%s", host_parms->basedir, Cmd_Argv(1)), sizeof(pakfile));
		if (!Q_strcasecmp(pakfile, com_gamedir)) //no change
		{
			Con_Printf("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
			return;
		}

		com_modified = true;

		//Kill the server
		CL_Disconnect ();
		Host_ShutdownServer(true);

		//Write config file
		Host_WriteConfiguration ();

		//Kill the extra game if it is loaded
		if (NumGames(com_searchpaths) > 1 + com_nummissionpacks)
			KillGameDir(com_searchpaths);

		q_strlcpy (com_gamedir, pakfile, sizeof(com_gamedir));

		if (Q_strcasecmp(Cmd_Argv(1), GAMENAME)) //game is not id1
		{
			// assign a path_id to this game directory
			if (com_searchpaths)
				path_id = com_searchpaths->path_id << 1;
			else	path_id = 1U;
			search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
			search->path_id = path_id;
			q_strlcpy (search->filename, pakfile, sizeof(search->filename));
			search->next = com_searchpaths;
			com_searchpaths = search;

			//Load the paks if any are found:
			for (i = 0; ; i++)
			{
				q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", com_gamedir, i);
				pak = COM_LoadPackFile (pakfile);
				if (!pak)
					break;
				search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
				search->path_id = path_id;
				search->pack = pak;
				search->next = com_searchpaths;
				com_searchpaths = search;
			}
		}

		//clear out and reload appropriate data
		Cache_Flush ();
		if (!isDedicated)
		{
			TexMgr_NewGame ();
			Draw_NewGame ();
			R_NewGame ();
		}
		ExtraMaps_NewGame ();
		//Cbuf_InsertText ("exec quake.rc\n");

		Con_Printf("\"game\" changed to \"%s\"\n", COM_SkipPath(com_gamedir));
	}
	else //Diplay the current gamedir
		Con_Printf("\"game\" is \"%s\"\n", COM_SkipPath(com_gamedir));
}