Exemplo n.º 1
0
void GAME_ReloadMode (void)
{
	const cgame_export_t *list = GAME_GetCurrentType();
	if (list != NULL) {
		GAME_SetMode(NULL);
		GAME_SetMode(list);
	}
}
Exemplo n.º 2
0
/**
 * @brief Decides with game mode should be set - takes the menu as reference
 */
static void GAME_SetMode_f (void)
{
	const char *modeName;
	int i;

	if (Cmd_Argc() == 2)
		modeName = Cmd_Argv(1);
	else
		modeName = UI_GetActiveWindowName();

	if (modeName[0] == '\0')
		return;

	for (i = 0; i < numCGameTypes; i++) {
		cgameType_t *t = &cgameTypes[i];
		if (Q_streq(t->window, modeName)) {
			const cgame_export_t *gametype;
#ifdef HARD_LINKED_CGAME
			cgameMenu = t->window;
#endif
			gametype = GetCGameAPI(GAME_GetImportData());
			GAME_SetMode(gametype);
			return;
		}
	}
	Com_Printf("GAME_SetMode_f: Mode '%s' not found\n", modeName);
}
Exemplo n.º 3
0
/**
 * @brief Saves configuration file and shuts the client systems down
 * @todo this is a callback from @c Sys_Quit and @c Com_Error. It would be better
 * to run quit through here before the final handoff to the sys code.
 * @sa Sys_Quit
 * @sa CL_Init
 */
void CL_Shutdown (void)
{
	if (isdown) {
		printf("recursive shutdown\n");
		return;
	}
	isdown = true;

	/* remove cvar feedback */
	for (const cvar_t* var = Cvar_GetFirst(); var; var = var->next) {
		if (var->flags & CVAR_R_CONTEXT)
			Cvar_UnRegisterChangeListener(var->name, CL_RContextCvarChange);
		if (var->flags & CVAR_R_IMAGES)
			Cvar_UnRegisterChangeListener(var->name, CL_RImagesCvarChange);
	}

	GAME_SetMode(nullptr);
	GAME_UnloadGame();
	CL_HTTP_Cleanup();
	Irc_Shutdown();
	Con_SaveConsoleHistory();
	Key_WriteBindings("keys.cfg");
	S_Shutdown();
	R_Shutdown();
	UI_Shutdown();
	CIN_Shutdown();
	SEQ_Shutdown();
	GAME_Shutdown();
	CL_LanguageShutdown();
	TOTD_Shutdown();
	SCR_Shutdown();
}
Exemplo n.º 4
0
void GAME_Drop (void)
{
	const cgame_export_t *list = GAME_GetCurrentType();

	if (list && list->Drop) {
		list->Drop();
	} else {
		SV_Shutdown("Drop", qfalse);
		GAME_SetMode(NULL);
		UI_InitStack("main", NULL, qfalse, qtrue);
	}
}
Exemplo n.º 5
0
/**
 * @brief Quits the current running game by calling the @c shutdown callback
 */
static void GAME_Exit_f (void)
{
	GAME_SetMode(NULL);
}