Example #1
0
bool OpenDebugLog(const char *path)
{
    PLOG(PL_INFO,"ProtoDebug>OpenDebugLog: debug log is being set to \"%s\"\n",path);
#ifdef OPNET  // JPH 4/26/06
	if ('\0' == *path) return false;
#endif  // OPNET
    CloseDebugLog();
    FILE* ptr = fopen(path, "w+");
    if (ptr)
    {
#if defined(WIN32) && !defined(SIMULATE)
        FILE* debugLog = DebugLog();
        if ((0 != DebugLevel()) && ((debugLog == stdout) || (debugLog == stderr))) 
            CloseDebugWindow();
#endif // WIN32 && !SIMULATE
        DebugLog(true, ptr);
        return true;
    }
    else
    {
#if defined(WIN32) && !defined(SIMULATE)
        FILE* debugLog = DebugLog();
        if ((0 != DebugLevel()) && (debugLog != stdout) && (debugLog != stderr)) 
            OpenDebugWindow();
#endif // WIN32 && !SIMULATE
        DebugLog(true, stderr);
        PLOG(PL_ERROR, "OpenDebugLog: Error opening debug log file: %s\n", path);
        return false;
    }
}  // end OpenLogFile()
Example #2
0
static int AppExit()
{
	SetNumLock(bNumlockStatus);

	DrvExit();						// Make sure any game driver is exitted
	FreeROMInfo();
	MediaExit();
	BurnLibExit();					// Exit the Burn library

#ifdef USE_SDL
	SDL_Quit();
#endif

	kailleraShutdown();

	FBALocaliseExit();

	if (hAccel) {
		DestroyAcceleratorTable(hAccel);
		hAccel = NULL;
	}

	SplashDestroy(1);

	CloseHandle(hMainThread);

	CloseDebugLog();

	return 0;
}
Example #3
0
static int AppExit()
{
	if(bIconsLoaded) {
		// unload driver icons
		UnloadDrvIcons();
		bIconsLoaded = 0;
	}

	SetNumLock(bNumlockStatus);

	DrvExit();						// Make sure any game driver is exitted
	FreeROMInfo();
	MediaExit();
	BurnLibExit();					// Exit the Burn library

#ifdef USE_SDL
	SDL_Quit();
#endif

	FBALocaliseExit();

	if (hAccel) {
		DestroyAcceleratorTable(hAccel);
		hAccel = NULL;
	}

	SplashDestroy(1);

	CloseHandle(hMainThread);

	CloseDebugLog();

	return 0;
}