diff --git a/Generals/Code/GameEngine/Source/Common/System/Debug.cpp b/Generals/Code/GameEngine/Source/Common/System/Debug.cpp index 46f23d4946..391a690c24 100644 --- a/Generals/Code/GameEngine/Source/Common/System/Debug.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/Debug.cpp @@ -171,9 +171,6 @@ inline HWND getThreadHWND() int MessageBoxWrapper( LPCSTR lpText, LPCSTR lpCaption, UINT uType ) { HWND threadHWND = getThreadHWND(); - if (!threadHWND) - return (uType & MB_ABORTRETRYIGNORE)?IDIGNORE:IDYES; - return ::MessageBox(threadHWND, lpText, lpCaption, uType); } @@ -422,8 +419,10 @@ void DebugLog(const char *format, ...) ScopedCriticalSection scopedCriticalSection(TheDebugLogCriticalSection); #endif +#ifdef DEBUG_LOGGING if (theDebugFlags == 0) - MessageBoxWrapper("DebugLog - Debug not inited properly", "", MB_OK|MB_TASKMODAL); + doLogOutput("DebugCrash - Debug not inited properly"); +#endif format = prepBuffer(format, theBuffer); @@ -475,7 +474,9 @@ void DebugCrash(const char *format, ...) ShowWindow(ApplicationHWnd, SW_HIDE); } } - MessageBoxWrapper("DebugCrash - Debug not inited properly", "", MB_OK|MB_TASKMODAL); +#ifdef DEBUG_LOGGING + doLogOutput("DebugCrash - Debug not inited properly"); +#endif } format = prepBuffer(format, theCrashBuffer); @@ -493,7 +494,7 @@ void DebugCrash(const char *format, ...) ShowWindow(ApplicationHWnd, SW_HIDE); } } - MessageBoxWrapper("String too long for debug buffers", "", MB_OK|MB_TASKMODAL); + MessageBoxWrapper("String too long for debug buffer", "", MB_OK|MB_TASKMODAL); } #ifdef DEBUG_LOGGING diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp index f9090dfa94..48f66f70b7 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/Debug.cpp @@ -172,9 +172,6 @@ inline HWND getThreadHWND() int MessageBoxWrapper( LPCSTR lpText, LPCSTR lpCaption, UINT uType ) { HWND threadHWND = getThreadHWND(); - if (!threadHWND) - return (uType & MB_ABORTRETRYIGNORE)?IDIGNORE:IDYES; - return ::MessageBox(threadHWND, lpText, lpCaption, uType); } @@ -423,8 +420,10 @@ void DebugLog(const char *format, ...) ScopedCriticalSection scopedCriticalSection(TheDebugLogCriticalSection); #endif +#ifdef DEBUG_LOGGING if (theDebugFlags == 0) - MessageBoxWrapper("DebugLog - Debug not inited properly", "", MB_OK|MB_TASKMODAL); + doLogOutput("DebugCrash - Debug not inited properly"); +#endif format = prepBuffer(format, theBuffer); @@ -476,7 +475,9 @@ void DebugCrash(const char *format, ...) ShowWindow(ApplicationHWnd, SW_HIDE); } } - MessageBoxWrapper("DebugCrash - Debug not inited properly", "", MB_OK|MB_TASKMODAL); +#ifdef DEBUG_LOGGING + doLogOutput("DebugCrash - Debug not inited properly"); +#endif } format = prepBuffer(format, theCrashBuffer); @@ -494,7 +495,7 @@ void DebugCrash(const char *format, ...) ShowWindow(ApplicationHWnd, SW_HIDE); } } - MessageBoxWrapper("String too long for debug buffers", "", MB_OK|MB_TASKMODAL); + MessageBoxWrapper("String too long for debug buffer", "", MB_OK|MB_TASKMODAL); } #ifdef DEBUG_LOGGING