OpenGL: Changed printf to DEBUG_LOG to avoid that it's always shown in the console window

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1801 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-01-06 01:50:57 +00:00
parent aacfb94059
commit cbdad3495d
5 changed files with 58 additions and 30 deletions

View File

@ -78,25 +78,30 @@ struct TRectangle
int left, top, right, bottom;
};
void DebugLog(const char* _fmt, ...);
void __Log(const char *format, ...);
//////////////////////////////////////////////////////////////////////////////////////////
// Logging
// ¯¯¯¯¯¯¯¯¯¯
void DebugLog(const char* _fmt, ...); // This one goes to the main program
void __Log(const char *format, ...); // This one is for the local console
void __Log(int type, const char *format, ...);
void HandleGLError();
#define ERROR_LOG __Log
#if defined(_DEBUG) || defined(DEBUGFAST)
// FIXME ugly hack for debug to build should use logmanager
//#define INFO_LOG if( g_Config.iLog & CONF_LOG ) __Log
//#define PRIM_LOG if( g_Config.iLog & CONF_PRIMLOG ) __Log
#define INFO_LOG __Log
#define PRIM_LOG __Log
#define DEBUG_LOG __Log
// FIXME ugly hack for debug to build should use logmanager
//#define INFO_LOG if( g_Config.iLog & CONF_LOG ) __Log
//#define PRIM_LOG if( g_Config.iLog & CONF_PRIMLOG ) __Log
#define INFO_LOG __Log
#define PRIM_LOG __Log
#define DEBUG_LOG __Log
#else
#define INFO_LOG(...)
#define PRIM_LOG(...)
#define DEBUG_LOG(...)
#define INFO_LOG(...)
#define PRIM_LOG(...)
#define DEBUG_LOG(...)
#endif
///////////////////////////////////
#endif // _VIDEOCOMMON_H

View File

@ -317,7 +317,7 @@ void BPWritten(int addr, int changes, int newval)
// TODO: Figure out how to do these in GL
//TEV_FSEL_BX, TEV_FSEL_BX2?
default:
printf("Non-Emulated Fog selection %d\n", bpmem.fog.c_proj_fsel.fsel);
DEBUG_LOG("Non-Emulated Fog selection %d\n", bpmem.fog.c_proj_fsel.fsel);
break;
}
}

View File

@ -15,12 +15,16 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
#if defined(HAVE_WX) && HAVE_WX
#include <wx/wx.h>
#include <wx/filepicker.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
#include <wx/aboutdlg.h>
#include <wx/wx.h>
#include <wx/filepicker.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
#include <wx/aboutdlg.h>
#endif
#include "Globals.h"
@ -30,11 +34,18 @@
#include "IniFile.h"
#include <assert.h>
/////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions
// ¯¯¯¯¯¯¯¯¯¯¯¯¯
#ifdef _WIN32
// The one for Linux is in Linux/Linux.cpp
// The Windows console handle. The one for Linux is in Linux/Linux.cpp
static HANDLE hConsole = NULL;
//////////////////////////////////
void OpenConsole()
{
@ -88,10 +99,10 @@ void __Log(const char *fmt, ...)
if (pfLog != NULL)
fwrite(Msg, strlen(Msg), 1, pfLog);
#ifdef _WIN32
DWORD tmp;
WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0);
#else
#ifdef _WIN32
DWORD tmp;
WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0);
#else
//printf("%s", Msg);
#endif
}

View File

@ -16,16 +16,22 @@
// http://code.google.com/p/dolphin-emu/
// --------------------
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// ¯¯¯¯¯¯¯¯¯¯
#include "../Globals.h"
#include <string>
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#endif
//////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions
// ¯¯¯¯¯¯¯¯¯¯
// --------------------
// On and off
bool g_consoleEnable = true;
@ -47,6 +53,7 @@ FILE* __fStdOut[1]; // you have to update this manually, we can't place a nFiles
#ifdef _WIN32
HANDLE __hStdOut = NULL;
#endif
///////////////////////////////////
// =======================================================================================
@ -159,6 +166,9 @@ void OpenConsole()
}
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Get the window handle of the console
// ¯¯¯¯¯¯¯¯¯¯
#if defined(DEBUGG) && defined(_WIN32)
HWND GetConsoleHwnd(void)
{
@ -200,3 +210,4 @@ HWND GetConsoleHwnd(void)
}
#endif // win32
////////////////////////////////////

View File

@ -145,9 +145,9 @@ void Logging(int a)
{
std::string sfbuff;
sfbuff = sfbuff + writeMessage(ii, 0);
#if defined(HAVE_WX) && HAVE_WX
aprintf(ii, (char *)sfbuff.c_str());
#endif
#if defined(HAVE_WX) && HAVE_WX
aprintf(ii, (char *)sfbuff.c_str());
#endif
}
// --------------
@ -258,9 +258,10 @@ void Logging(int a)
// =======================================================================================
// Print
// ----------------
#if defined(HAVE_WX) && HAVE_WX
ClearScreen();
#endif
#if defined(HAVE_WX) && HAVE_WX
ClearScreen();
#endif
__Log("%s", sbuff.c_str());
sbuff.clear(); strcpy(buffer, "");
// ================