Ejemplo n.º 1
0
/*
* CL_ShutdownCinematics
*/
void CL_ShutdownCinematics( void )
{
	Cmd_RemoveCommand( "cinematic" );
	Cmd_RemoveCommand( "cinepause" );

	CIN_UnloadLibrary( qtrue );
}
Ejemplo n.º 2
0
/*
================
FS_Shutdown

Frees all resources and closes all files
================
*/
void FS_Shutdown( void ) {
	searchpath_t	*p, *next;
	int	i;

	for(i = 0; i < MAX_FILE_HANDLES; i++) {
		if (fsh[i].fileSize) {
			FS_FCloseFile(i);
		}
	}

	// free everything
	for ( p = fs_searchpaths ; p ; p = next ) {
		next = p->next;

		if ( p->pack ) {
			unzClose(p->pack->handle);
			Z_Free( p->pack->buildBuffer );
			Z_Free( p->pack );
		}
		if ( p->dir ) {
			Z_Free( p->dir );
		}
		Z_Free( p );
	}

	// any FS_ calls will now be an error until reinitialized
	fs_searchpaths = NULL;

	Cmd_RemoveCommand( "path" );
	Cmd_RemoveCommand( "dir" );
	Cmd_RemoveCommand( "fdir" );
	Cmd_RemoveCommand( "touchFile" );

	initialized = qfalse;
}
Ejemplo n.º 3
0
/**
 * @brief Closing actions for alien interests-subsystem
 */
void INT_Shutdown (void)
{
#ifdef DEBUG
	Cmd_RemoveCommand("debug_interestlist");
	Cmd_RemoveCommand("debug_interestset");
#endif
}
Ejemplo n.º 4
0
void S_Shutdown(void)
{
	int		i;
	sfx_t	*sfx;

	if (!sound_started)
		return;

	SNDDMA_Shutdown();

	sound_started = 0;

	Cmd_RemoveCommand("play");
	Cmd_RemoveCommand("stopsound");
	Cmd_RemoveCommand("soundlist");
	Cmd_RemoveCommand("soundinfo");

	// free all sounds
	for (i=0, sfx=known_sfx ; i < num_sfx ; i++,sfx++)
	{
		if (!sfx->name[0])
			continue;
		memset (sfx, 0, sizeof(*sfx));
	}

	num_sfx = 0;
}
Ejemplo n.º 5
0
void Com_ShutdownZoneMemory(void)
{
	assert(s_Initialized);

	// Remove commands
	Cmd_RemoveCommand("zone_stats");
	Cmd_RemoveCommand("zone_details");
	Cmd_RemoveCommand("zone_memmap");

	if (s_Stats.m_CountAlloc)
	{
		// Free all memory
//		CM_ReleaseVisData();
		Z_TagFree(TAG_ALL);
	}
	
	// Clear some globals
	memset(&s_Stats, 0, sizeof(s_Stats));
	memset(s_FreeOverflow, 0, sizeof(s_FreeOverflow));
	s_LastOverflowIndex = 0;
	s_LinkBase = NULL;

	// Free the pool
#ifndef _GAMECUBE
	GlobalFree(s_PoolBase);
	CloseHandle(s_Mutex);
#endif

	s_PoolBase = NULL;
	s_Initialized = false;
}
Ejemplo n.º 6
0
void Dynvar_Shutdown( void )
{
	if( dynvar_initialized )
	{
		struct trie_dump_s *dump;
		unsigned int i;

		assert( dynvar_trie );

		Cmd_RemoveCommand( "dynvarlist" );
		Cmd_RemoveCommand( "setdyn" );

		Trie_Dump( dynvar_trie, "", TRIE_DUMP_VALUES, &dump );
		for( i = 0; i < dump->size; i++ )
		{
			Dynvar_Destroy( (dynvar_t *)dump->key_value_vector[i].value );
		}
		Trie_FreeDump( dump );

		dynvar_initialized = qfalse;
	}

	if( dynvar_preinitialized )
	{
		assert( dynvar_trie );

		Trie_Destroy( dynvar_trie );
		dynvar_trie = NULL;

		dynvar_preinitialized = qfalse;
	}
}
Ejemplo n.º 7
0
void
IN_Shutdown(void)
{
	Cmd_RemoveCommand("force_centerview");
	Cmd_RemoveCommand("+mlook");
	Cmd_RemoveCommand("-mlook");

	Com_Printf("Shutting down input.\n");

#if SDL_VERSION_ATLEAST(2, 0, 0)
	IN_Haptic_Shutdown();

	if (controller)
	{
		back_button_id = -1;
		SDL_GameControllerClose(controller);
		controller  = NULL;
	}

	if (joystick)
	{
		SDL_JoystickClose(joystick);
		joystick = NULL;
	}
#endif
}
Ejemplo n.º 8
0
/**
 * @sa S_Init
 * @sa S_Restart_f
 */
void S_Shutdown (void)
{
    if (!s_env.initialized)
        return;

    M_Shutdown();

    S_Stop();

    Mix_AllocateChannels(0);

    S_FreeSamples();

    Mix_CloseAudio();

    if (SDL_WasInit(SDL_INIT_EVERYTHING) == SDL_INIT_AUDIO)
        SDL_Quit();
    else
        SDL_QuitSubSystem(SDL_INIT_AUDIO);

    Mem_DeletePool(cl_soundSysPool);

    Cmd_RemoveCommand("snd_play");
    Cmd_RemoveCommand("snd_restart");

#if COMPARE_VERSION(1, 2, 10)
    Mix_Quit();
#endif

    s_env.initialized = false;
}
Ejemplo n.º 9
0
void S_Shutdown(void)
{
	if (!sound_started)
		return;

	Cmd_RemoveCommand("play");
	Cmd_RemoveCommand("stopsound");
	Cmd_RemoveCommand("soundlist");
	Cmd_RemoveCommand("soundinfo");

	S_FreeAllSounds();

#ifdef USE_OPENAL
	if(alSound)
	{
		ALSnd_Shutdown();
		alSound = false;
	}
	else
#endif
	{
		SNDDMA_Shutdown();
	}

	sound_started = false;
}
Ejemplo n.º 10
0
/*
 * Shuts the backend down
 */
void
IN_BackendShutdown(void)
{
    Cmd_RemoveCommand("+mlook");
    Cmd_RemoveCommand("-mlook");
    Cmd_RemoveCommand("force_centerview");
    VID_Printf(PRINT_ALL, "Input shut down.\n");
}
Ejemplo n.º 11
0
/**
 * @brief Closing operations for installations subsystem
 */
void INS_Shutdown (void)
{
	LIST_Delete(&ccs.installations);
#ifdef DEBUG
	Cmd_RemoveCommand("debug_listinstallation");
	Cmd_RemoveCommand("debug_finishinstallation");
#endif
}
Ejemplo n.º 12
0
/*
* Memory_ShutdownCommands
*/
void Memory_ShutdownCommands( void )
{
	if( !commands_initialized )
		return;

	Cmd_RemoveCommand( "memlist" );
	Cmd_RemoveCommand( "memstats" );
}
Ejemplo n.º 13
0
void
FS_Shutdown(void)
{
	int i;
	fsHandle_t *handle;
	fsSearchPath_t *next;
	fsPack_t *pack;

	/* Unregister commands. */
	Cmd_RemoveCommand("dir");
	Cmd_RemoveCommand("link");
	Cmd_RemoveCommand("path");

	/* Close all files. */
	for (i = 0, handle = fs_handles; i < MAX_HANDLES; i++, handle++)
	{
		if (handle->file != NULL)
		{
			fclose(handle->file);
		}

#ifdef ZIP
		if (handle->zip != NULL)
		{
			unzCloseCurrentFile(handle->zip);
			unzClose(handle->zip);
		}
#endif
	}

	/* Free the search paths. */
	while (fs_searchPaths != NULL)
	{
		if (fs_searchPaths->pack != NULL)
		{
			pack = fs_searchPaths->pack;

			if (pack->pak != NULL)
			{
				fclose(pack->pak);
			}

#ifdef ZIP
			if (pack->pk3 != NULL)
			{
				unzClose(pack->pk3);
			}
#endif

			Z_Free(pack->files);
			Z_Free(pack);
		}

		next = fs_searchPaths->next;
		Z_Free(fs_searchPaths);
		fs_searchPaths = next;
	}
}
Ejemplo n.º 14
0
/**
 * @brief Reset and free the UI data hunk
 * @note Even called in case of an error when CL_Shutdown was called - maybe even
 * before CL_InitLocal (and thus UI_Init) was called
 * @sa CL_Shutdown
 * @sa UI_Init
 */
void UI_Shutdown (void)
{
	/* MN is not yet initialized */
	if (ui_global.adata == nullptr)
		return;

	const uiBehaviour_t* confunc = UI_GetNodeBehaviour("confunc");

	/* remove all confunc commands */
	uiNode_t** nodes[] = {ui_global.windows, ui_global.components};
	for (int nodeType = 0; nodeType < 2; ++nodeType) {
		for (int i = 0; i < ui_global.numWindows; i++) {
			uiNode_t* node = nodes[nodeType][i];
			while (node) {
				/* remove the command */
				if (node->behaviour == confunc) {
					/* many nodes to one command is allowed */
					if (Cmd_Exists(node->name)) {
						Cmd_RemoveCommand(node->name);
					}
				}

				/* recursive next */
				if (node->firstChild != nullptr) {
					node = node->firstChild;
					continue;
				}
				while (node) {
					if (node->next != nullptr) {
						node = node->next;
						break;
					}
					node = node->parent;
				}
			}
		}
	}
	UI_ShutdownLua();
	UI_FontShutdown();
	UI_ResetInput();
	UI_ResetTimers();

#ifdef DEBUG
	Cmd_RemoveCommand("debug_uimemory");
#endif
	Cmd_RemoveCommand("ui_restart");

	Mem_Free(ui_global.adata);
	OBJZERO(ui_global);

	/* release pools */
	Mem_FreePool(ui_sysPool);
	Mem_FreePool(ui_dynStringPool);
	Mem_FreePool(ui_dynPool);
	ui_sysPool = nullptr;
	ui_dynStringPool = nullptr;
	ui_dynPool = nullptr;
}
Ejemplo n.º 15
0
////-----------
/// FF_Shutdown
//---------------
//	Shut force feedback system down and free resources.
//
//	Assumptions:
//	*	Always called if FF_Init returns qfalse. ALWAYS. (Or memory leaks occur)
//	*	Never called twice in succession. (always in response to previous assumption)
//
//	Parameters:
//		None
//
//	Returns:
//		None
//
void FF_Shutdown(void)
{
#ifdef FF_CONSOLECOMMAND
	Cmd_RemoveCommand( "ff_stopall" );
	Cmd_RemoveCommand( "ff_info" );
#endif

	gFFSystem.Shutdown();
}
Ejemplo n.º 16
0
/*
 * Cl_ShutdownKeys
 */
void Cl_ShutdownKeys(void) {

	Cl_WriteHistory();

	Cmd_RemoveCommand("bind");
	Cmd_RemoveCommand("unbind");
	Cmd_RemoveCommand("unbind_all");
	Cmd_RemoveCommand("bind_list");
}
Ejemplo n.º 17
0
/*
 * Shuts the backend down
 */
void
IN_Shutdown(void)
{
	Cmd_RemoveCommand("force_centerview");
	Cmd_RemoveCommand("+mlook");
	Cmd_RemoveCommand("-mlook");

    Com_Printf("Shutting down input.\n");
}
Ejemplo n.º 18
0
/*
===============
GLimp_Shutdown
===============
*/
void WIN_Shutdown( void )
{
	Cmd_RemoveCommand("modelist");
	Cmd_RemoveCommand("minimize");

	IN_Shutdown();

	SDL_QuitSubSystem( SDL_INIT_VIDEO );
	screen = NULL;
}
Ejemplo n.º 19
0
void NavEditShutdown()
{
#ifndef BUILD_SERVER
	Cmd_RemoveCommand( "navedit" );
	Cmd_RemoveCommand( "addcon" );
	Cmd_RemoveCommand( "conSizeUp" );
	Cmd_RemoveCommand( "conSizeDown" );
	Cmd_RemoveCommand( "navtest" );
#endif
}
Ejemplo n.º 20
0
/*
==================
SV_RemoveOperatorCommands
==================
*/
void SV_RemoveOperatorCommands( void ) {
#if 0
	// removing these won't let the server start again
	Cmd_RemoveCommand ("heartbeat");
	Cmd_RemoveCommand ("serverinfo");
	Cmd_RemoveCommand ("systeminfo");
	Cmd_RemoveCommand ("map_restart");
	Cmd_RemoveCommand ("sectorlist");
#endif
}
Ejemplo n.º 21
0
void Key_Shutdown( void )
{
	if( !key_initialized )
		return;

	Cmd_RemoveCommand( "bind" );
	Cmd_RemoveCommand( "unbind" );
	Cmd_RemoveCommand( "unbindall" );
	Cmd_RemoveCommand( "bindlist" );

	Key_Unbindall();
}
Ejemplo n.º 22
0
void S_Base_Shutdown( void ) {
	if ( !s_soundStarted ) {
		return;
	}

	SNDDMA_Shutdown();

	s_soundStarted = 0;

	Cmd_RemoveCommand("s_info");
	Cmd_RemoveCommand("s_devlist");
}
Ejemplo n.º 23
0
/*
==================
SV_RemoveOperatorCommands
==================
*/
void SV_RemoveOperatorCommands( void )
{
	Cmd_RemoveCommand( "dumpuser" );
	Cmd_RemoveCommand( "fieldinfo" );
	Cmd_RemoveCommand( "heartbeat" );
	Cmd_RemoveCommand( "killserver" );
	Cmd_RemoveCommand( "map_restart" );
	Cmd_RemoveCommand( "say" );
	Cmd_RemoveCommand( "sectorlist" );
	Cmd_RemoveCommand( "serverinfo" );
	Cmd_RemoveCommand( "status" );
	Cmd_RemoveCommand( "systeminfo" );
}
Ejemplo n.º 24
0
void IN_Shutdown (void)
{
	if (!mouse_avail)
		return;

	IN_Activate(false);

	mouse_avail = false;

	Cmd_RemoveCommand ("+mlook");
	Cmd_RemoveCommand ("-mlook");
	Cmd_RemoveCommand ("force_centerview");
}
Ejemplo n.º 25
0
Archivo: snd_ogg.c Proyecto: ZwS/qudos
/*
==========
OGG_Shutdown

Shutdown the Ogg Vorbis subsystem.
==========
*/
void OGG_Shutdown(void)
{

	if (!ogg_started)
		return;

	Com_Printf("Shutting down Ogg Vorbis.\n");

	OGG_Stop();

	/* Free the list of files. */
	FS_FreeList(ogg_filelist, ogg_numfiles + 1);

	/* Remove console commands. */
	Cmd_RemoveCommand("ogg_list");
	Cmd_RemoveCommand("ogg_pause");
	Cmd_RemoveCommand("ogg_play");
	Cmd_RemoveCommand("ogg_reinit");
	Cmd_RemoveCommand("ogg_resume");
	Cmd_RemoveCommand("ogg_seek");
	Cmd_RemoveCommand("ogg_status");
	Cmd_RemoveCommand("ogg_stop");

	ogg_started = false;
}
Ejemplo n.º 26
0
void GAME_SK_Shutdown (void)
{
	Cmd_RemoveCommand("sk_start");
	Cmd_RemoveCommand("sk_nextequip");
	Cmd_RemoveCommand("sk_prevequip");
	Cmd_RemoveCommand("game_go");

	UI_ResetData(OPTION_DROPSHIPS);
	UI_ResetData(OPTION_UFOS);

	SV_Shutdown("Quitting server.", qfalse);

	chrDisplayList.num = 0;
}
Ejemplo n.º 27
0
/*
============
CL_RegisterButtonCommands
============
*/
void CL_RegisterButtonCommands( const char *cmd_names )
{
	static char    *registered[ USERCMD_BUTTONS ] = { NULL };
	char           name[ 100 ];
	int            i;

	for ( i = 0; i < USERCMD_BUTTONS; ++i )
	{
		if ( registered[ i ] )
		{
			Cmd_RemoveCommand( registered[ i ] );
			registered[ i ][ 0 ] = '-';
			Cmd_RemoveCommand( registered[ i ] );
			Z_Free( registered[ i ] );
			registered[ i ] = NULL;
		}
	}

	for ( i = 0; cmd_names && i < USERCMD_BUTTONS; ++i )
	{
		char *term;

		if ( *cmd_names == ',' )
		{
			// no command for this button - do the next one
			++cmd_names;
			continue;
		}

		term = strchr( cmd_names, ',' );

		Q_snprintf( name + 1, sizeof( name ) - 1, "%.*s",
		            (int)( term ? ( term - cmd_names ) : sizeof ( name ) - 1 ), cmd_names );

		if ( Cmd_AddButtonCommand( name + 1, KB_BUTTONS + i ) )
		{
			// store a copy of the name, '+'-prefixed ready for unregistration
			name[0] = '+';
			registered[i] = CopyString( name );
		}

		cmd_names = term + !!term;
	}

	if ( cmd_names )
	{
		Com_Printf(_( "^1BUG: cgame: some button commands left unregistered (\"%s\")\n"), cmd_names );
	}
}
Ejemplo n.º 28
0
/*
============
CL_RegisterButtonCommands

Get a list of buttons from cgame (USERCMD_BUTTONS comma sperated names)
and registers the appropriate commands.
============
*/
void CL_RegisterButtonCommands( const char *cmd_names )
{
	char name[100];
	int i;

	for ( i = 0; i < USERCMD_BUTTONS; ++i )
	{
		if ( registeredButtonCommands[ i ] )
		{
			Cmd_RemoveCommand( registeredButtonCommands[ i ] );
			registeredButtonCommands[ i ][ 0 ] = '-';
			Cmd_RemoveCommand( registeredButtonCommands[ i ] );
			Z_Free( registeredButtonCommands[ i ] );
			registeredButtonCommands[ i ] = nullptr;
		}
	}

	for ( i = 0; cmd_names && i < USERCMD_BUTTONS; ++i )
	{
		const char *term;

		if ( *cmd_names == ',' )
		{
			// no command for this button - do the next one
			++cmd_names;
			continue;
		}

		term = strchr( cmd_names, ',' );

		Q_snprintf( name + 1, sizeof( name ) - 1, "%.*s",
		            (int)( term ? ( term - cmd_names ) : sizeof ( name ) - 1 ), cmd_names );

		name[0] = '-';
		Cmd_AddCommand( name, IN_BuiltinButtonCommand );
		name[0] = '+';
		Cmd_AddCommand( name, IN_BuiltinButtonCommand );

		// store a copy of the name, '+'-prefixed ready for unregistration
		registeredButtonCommands[i] = CopyString( name );

		cmd_names = term + !!term;
	}

	if ( cmd_names )
	{
		Com_Printf( S_WARNING "cgame: some button commands left unregistered (\"%s\")", cmd_names );
	}
}
Ejemplo n.º 29
0
void S_Shutdown()
{
	if (si.Shutdown)
		si.Shutdown();

	Com_Memset( &si, 0, sizeof(si) );

	Cmd_RemoveCommand( "play" );
	Cmd_RemoveCommand( "music" );
	Cmd_RemoveCommand( "s_list" );
	Cmd_RemoveCommand( "s_stop" );
	Cmd_RemoveCommand( "s_info" );

	S_CodecShutdown();
}
Ejemplo n.º 30
0
void S_Shutdown( void ) {
	if ( !s_soundStarted ) {
		return;
	}

	SNDDMA_Shutdown();

	s_soundStarted = 0;

    Cmd_RemoveCommand("play");
	Cmd_RemoveCommand("music");
	Cmd_RemoveCommand("stopsound");
	Cmd_RemoveCommand("soundlist");
	Cmd_RemoveCommand("soundinfo");
}