From 54a5947a3c510c1607739eaef95dbddb001c9b9e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 15 Dec 2023 06:39:26 +0300 Subject: [PATCH] engine: remove MSGBOX macro --- engine/common/crashhandler.c | 2 +- engine/common/host.c | 2 +- engine/common/system.c | 4 ++-- engine/common/system.h | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/common/crashhandler.c b/engine/common/crashhandler.c index 4ae42ab0..c265b443 100644 --- a/engine/common/crashhandler.c +++ b/engine/common/crashhandler.c @@ -490,7 +490,7 @@ static void Sys_Crash( int signal, siginfo_t *si, void *context) #ifdef XASH_SDL SDL_SetWindowGrab( host.hWnd, SDL_FALSE ); #endif - MSGBOX( message ); + Platform_MessageBox( "Xash Error", message, false ); // log saved, now we can try to save configs and close log correctly, it may crash if( host.type == HOST_NORMAL ) diff --git a/engine/common/host.c b/engine/common/host.c index 8558221f..da19aee6 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -795,7 +795,7 @@ void GAME_EXPORT Host_Error( const char *error, ... ) Key_SetKeyDest( key_console ); Con_Printf( "Host_Error: %s", hosterror1 ); } - else MSGBOX2( hosterror1 ); + else Platform_MessageBox( "Host Error", hosterror1, true ); } // host is shutting down. don't invoke infinite loop diff --git a/engine/common/system.c b/engine/common/system.c index f04a2d74..d977e8dd 100644 --- a/engine/common/system.c +++ b/engine/common/system.c @@ -402,7 +402,7 @@ void Sys_Warn( const char *format, ... ) Msg( "Sys_Warn: %s\n", text ); if( !Host_IsDedicated() ) // dedicated server should not hang on messagebox - MSGBOX(text); + Platform_MessageBox( "Xash Warning", text, false ); } /* @@ -446,8 +446,8 @@ void Sys_Error( const char *error, ... ) #if XASH_WIN32 Wcon_ShowConsole( false ); #endif - MSGBOX( text ); Sys_Print( text ); + Platform_MessageBox( "Xash Error", text, false ); } else { diff --git a/engine/common/system.h b/engine/common/system.h index a14a1a07..d06055f7 100644 --- a/engine/common/system.h +++ b/engine/common/system.h @@ -30,9 +30,6 @@ extern "C" { #include "crtlib.h" #include "platform/platform.h" -#define MSGBOX( x ) Platform_MessageBox( "Xash Error", (x), false ) -#define MSGBOX2( x ) Platform_MessageBox( "Host Error", (x), true ) -#define MSGBOX3( x ) Platform_MessageBox( "Host Recursive Error", (x), true ) #define ASSERT( exp ) if(!( exp )) Sys_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ ) /*