From a8ad005d4250d718a5983e4205f7dc1a099577f3 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 23 Dec 2024 22:09:28 +0100 Subject: [PATCH] Use SDL_LogXXX instead of OutputDebugString --- LEGO1/mxdirectx/mxdirectxinfo.cpp | 6 ++---- LEGO1/omni/src/common/mxdebug.cpp | 6 ++---- LEGO1/omni/src/video/mxdisplaysurface.cpp | 3 ++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/LEGO1/mxdirectx/mxdirectxinfo.cpp b/LEGO1/mxdirectx/mxdirectxinfo.cpp index 4d2950e3..a768b8c8 100644 --- a/LEGO1/mxdirectx/mxdirectxinfo.cpp +++ b/LEGO1/mxdirectx/mxdirectxinfo.cpp @@ -1,6 +1,7 @@ #include "mxdirectxinfo.h" #include +#include #include // for vsprintf DECOMP_SIZE_ASSERT(MxAssignedDevice, 0xe4) @@ -260,13 +261,10 @@ BOOL MxDeviceEnumerate::EnumDirectDrawCallback(LPGUID p_guid, LPSTR p_driverDesc void MxDeviceEnumerate::BuildErrorString(const char* p_format, ...) { va_list args; - char buf[512]; va_start(args, p_format); - vsprintf(buf, p_format, args); + SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, p_format, args); va_end(args); - - OutputDebugString(buf); } // FUNCTION: CONFIG 0x00401bf0 diff --git a/LEGO1/omni/src/common/mxdebug.cpp b/LEGO1/omni/src/common/mxdebug.cpp index f372635c..e553bb0d 100644 --- a/LEGO1/omni/src/common/mxdebug.cpp +++ b/LEGO1/omni/src/common/mxdebug.cpp @@ -7,7 +7,7 @@ // This is the most widely used version. #include -#include +#include // FUNCTION: BETA10 0x10124cb9 int DebugHeapState() @@ -19,11 +19,9 @@ int DebugHeapState() void _MxTrace(const char* format, ...) { va_list args; - char buffer[256]; va_start(args, format); - _vsnprintf(buffer, 256, format, args); - OutputDebugString(buffer); + SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_CATEGORY_DEBUG, SDL_LOG_PRIORITY_TRACE, format, args); va_end(args); } diff --git a/LEGO1/omni/src/video/mxdisplaysurface.cpp b/LEGO1/omni/src/video/mxdisplaysurface.cpp index d08322ce..978e323b 100644 --- a/LEGO1/omni/src/video/mxdisplaysurface.cpp +++ b/LEGO1/omni/src/video/mxdisplaysurface.cpp @@ -9,6 +9,7 @@ #include "mxvideomanager.h" #include +#include #include DECOMP_SIZE_ASSERT(MxDisplaySurface, 0xac); @@ -834,7 +835,7 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p m_ddSurface2->Unlock(ddsd.lpSurface); } else { - OutputDebugString("MxDisplaySurface::Display error\n"); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "MxDisplaySurface::Display error\n"); } } m_ddSurface1->Flip(NULL, DDFLIP_WAIT);