Пример #1
0
/**
 * @brief Errors out of the game.
 * @note The error message should not have a newline - it's added inside of this function
 * @note This function does never return
 */
void Sys_Error (const char *error, ...)
{
	va_list argptr;
	char string[1024];

	Sys_Backtrace();

#ifdef COMPILE_UFO
	Sys_ConsoleShutdown();
#endif

	/* change stdin to non blocking */
	fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);

#ifdef COMPILE_MAP
	Mem_Shutdown();
#endif

	va_start(argptr,error);
	Q_vsnprintf(string, sizeof(string), error, argptr);
	va_end(argptr);

	fprintf(stderr, "Error: %s\n", string);

	exit(1);
}
Пример #2
0
int main (int argc, char **argv)
{
    char bspFilename[MAX_OSPATH];

    if (argc < 2) {
        Usage();
    }

    com_genericPool = Mem_CreatePool("slicer");
    com_fileSysPool = Mem_CreatePool("slicer filesys");

    Swap_Init();
    Mem_Init();

    SL_Parameter(argc, argv);

    Com_StripExtension(config.filename, bspFilename, sizeof(bspFilename));
    Com_DefaultExtension(bspFilename, sizeof(bspFilename), ".bsp");

    FS_InitFilesystem(false);
    SL_BSPSlice(LoadBSPFile(bspFilename), config.thickness, config.scale, config.singleContour, config.multipleContour);

    Mem_Shutdown();

    return EXIT_SUCCESS;
}
Пример #3
0
/**
 * @brief Teardown fixture.
 */
void teardown(void) {

	Cmd_Shutdown();

	Fs_Shutdown();

	Mem_Shutdown();
}
Пример #4
0
/**
 * @brief
 * @sa Qcommon_Init
 * @sa Sys_Quit
 * @note Don't call anything that depends on cvars, command system, or any other
 * subsystem that is allocated in the mem pools and maybe already freed
 */
void Qcommon_Shutdown (void)
{
	HTTP_Cleanup();

	FS_Shutdown();
	Cvar_Shutdown();
	Cmd_Shutdown();
	NET_Shutdown();
	Mem_Shutdown();
	Com_Shutdown();
}
Пример #5
0
/**
 * @brief Com_Shutdown implementation.
 */
static void Shutdown(const char *msg) {

	if (msg) {
		fputs(msg, stdout);
	}

	g_list_free_full(ms_servers, Mem_Free);

	Fs_Shutdown();

	Mem_Shutdown();
}
Пример #6
0
/**
 * @brief
 * @sa Qcommon_Shutdown
 */
void Sys_Quit (void)
{
#ifdef COMPILE_UFO
	CL_Shutdown();
	Qcommon_Shutdown();
	Sys_ConsoleShutdown();
#elif COMPILE_MAP
	Mem_Shutdown();
#endif

	fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) & ~FNDELAY);
	exit(0);
}
Пример #7
0
void Sys_Quit (void)
{
	timeEndPeriod(1);

#ifdef COMPILE_UFO
	CL_Shutdown();
	Qcommon_Shutdown();
#elif COMPILE_MAP
	Mem_Shutdown();
#endif

	/* exit(0) */
	ExitProcess(0);
}
Пример #8
0
/*
================
idLib::ShutDown
================
*/
void idLib::ShutDown( void ) {

	// shut down the dictionary string pools
	idDict::Shutdown();

	// shut down the string memory allocator
	idStr::ShutdownMemory();

	// shut down the SIMD engine
	idSIMD::Shutdown();

	// shut down the memory manager
	Mem_Shutdown();
}
Пример #9
0
void TEST_Shutdown (void)
{
	SV_Shutdown("test shutdown", qfalse);
	FS_Shutdown();
	Cmd_Shutdown();
	Cvar_Shutdown();
	Mem_Shutdown();
	Com_Shutdown();
	Cbuf_Shutdown();
	NET_Shutdown();

	com_aliasSysPool = NULL;
	com_cmdSysPool = NULL;
	com_cmodelSysPool = NULL;
	com_cvarSysPool = NULL;
	com_fileSysPool = NULL;
	com_genericPool = NULL;
}
Пример #10
0
static void Usage (void)
{
    Com_Printf("Usage: ./ufoslicer -t N -s N -c -m bspfile\n");
    Com_Printf("\n");
    Com_Printf(" -t N      = use slice thickness of N units.\n");
    Com_Printf(" -s N      = use scale factor of N.\n");
    Com_Printf(" -c        = create a single contour map.\n");
    Com_Printf(" -m        = create multiple contour maps.\n");
    Com_Printf(" -h|--help = show this help screen.\n");
    Com_Printf("\n");
    Com_Printf("For example: ./ufoslicer -t 64 -s 8 maps/farm\n");
    Com_Printf("would slice the map \"farm.bsp\", moving by 64 units between slices and\n");
    Com_Printf("would create a 1/8th scale bitmap file.\n");
    Com_Printf("\n");
    Com_Printf("The default for -t is 64 units.\n");

    Mem_Shutdown();

    exit(EXIT_FAILURE);
}
Пример #11
0
void TEST_Shutdown (void)
{
	PTL_InitStartup();
	R_ShutdownImages();
	SV_Shutdown("test shutdown", false);
	FS_Shutdown();
	UI_Shutdown();
	Cmd_Shutdown();
	developer = nullptr;
	Cvar_Shutdown();
	Mem_Shutdown();
	Com_Shutdown();
	Cbuf_Shutdown();
	NET_Shutdown();

	com_aliasSysPool = nullptr;
	com_cmdSysPool = nullptr;
	com_cmodelSysPool = nullptr;
	com_cvarSysPool = nullptr;
	com_fileSysPool = nullptr;
	com_genericPool = nullptr;
}
Пример #12
0
void Sys_Error (const char *error, ...)
{
	va_list argptr;
	char text[1024];

	Sys_Backtrace();

#ifdef COMPILE_MAP
	Mem_Shutdown();
#endif

	va_start(argptr, error);
	Q_vsnprintf(text, sizeof(text), error, argptr);
	va_end(argptr);

	/* Echo to console */
	Sys_ConsoleOutput("\n");
	Sys_ConsoleOutput(text);
	Sys_ConsoleOutput("\n");

	/* Display the message and set a timer so we can flash the text */
	SetWindowText(sys_console.hWndMsg, text);
	SetTimer(sys_console.hWnd, 1, 1000, NULL);

	sys_console.timerActive = true;

	/* Show/hide everything we need */
	ShowWindow(sys_console.hWndMsg, SW_SHOW);
	ShowWindow(sys_console.hWndInput, SW_HIDE);

	Sys_ShowConsole(true);

	/* Wait for the user to quit */
	while (1) {
		Sys_ConsoleLoop(true);
		/* Don't hog the CPU */
		Sys_Sleep(25);
	}
}
Пример #13
0
/**
 * @brief Cleans up all game engine subsystems.
 */
static void Shutdown(const char *msg) {

	Com_Print("%s", msg);

	Sv_Shutdown(msg);

	Cl_Shutdown();

	Netchan_Shutdown();

	Thread_Shutdown();

	Con_Shutdown();

	Cvar_Shutdown();

	Cmd_Shutdown();

	Fs_Shutdown();

	Mem_Shutdown();

	SDL_Quit();
}
Пример #14
0
/**
 * @brief Teardown fixture.
 */
void teardown(void) {

	Fs_Shutdown();

	Mem_Shutdown();
}
Пример #15
0
/**
 * @brief Teardown fixture.
 */
void teardown(void) {
	Mem_Shutdown();
}
Пример #16
0
/*
 * @brief Teardown fixture.
 */
void teardown(void) {

    Thread_Shutdown();

    Mem_Shutdown();
}
Пример #17
0
/**
 * @brief Teardown fixture.
 */
void teardown(void) {

	R_ShutdownMedia();

	Mem_Shutdown();
}