diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index e790407d4d..366d135bff 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -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 diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index 48aaf120d3..aba8f05d0e 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -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; } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp index a934286d8f..0fe4e32e48 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp @@ -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 -#include -#include -#include -#include + #include + #include + #include + #include + #include #endif #include "Globals.h" @@ -30,11 +34,18 @@ #include "IniFile.h" #include +///////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////////////////// +// 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 } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Logging/Console.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Logging/Console.cpp index 07ee9c1138..d6f2d835b3 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Logging/Console.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Logging/Console.cpp @@ -16,16 +16,22 @@ // http://code.google.com/p/dolphin-emu/ -// -------------------- +////////////////////////////////////////////////////////////////////////////////////////// // Includes +// ŻŻŻŻŻŻŻŻŻŻ #include "../Globals.h" #include #include #ifdef _WIN32 #include #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 +//////////////////////////////////// \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Logging/Logging.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Logging/Logging.cpp index eeefb61bf5..efd0299b63 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Logging/Logging.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Logging/Logging.cpp @@ -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, ""); // ================