From 059c2fc6bbf2957b98fb20fbee2cc14a26f443f6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 9 Feb 2008 19:17:19 +0000 Subject: Remove some unneeded functions from i_system.c. Make I_Error exit using exit() rather than abort(). Display a message box with the error on Windows. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1065 --- src/i_system.c | 71 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'src/i_system.c') diff --git a/src/i_system.c b/src/i_system.c index 13a68ee0..0f2841c9 100644 --- a/src/i_system.c +++ b/src/i_system.c @@ -31,6 +31,10 @@ #include +#ifdef _WIN32 +#include +#endif + #include "deh_main.h" #include "doomdef.h" #include "doomstat.h" @@ -51,27 +55,15 @@ #include "w_wad.h" #include "z_zone.h" +int mb_used = 16; +int show_endoom = 1; -int mb_used = 16; -int show_endoom = 1; - -void -I_Tactile -( int on, - int off, - int total ) -{ - // UNUSED. - on = off = total = 0; -} +// Tactile feedback function, probably used for the Logitech Cyberman -ticcmd_t emptycmd; -ticcmd_t* I_BaseTiccmd(void) +void I_Tactile(int on, int off, int total) { - return &emptycmd; } - int I_GetHeapSize (void) { int p; @@ -107,7 +99,6 @@ byte *I_ZoneBase (int *size) } - // // I_Init // @@ -165,6 +156,7 @@ void I_Endoom(void) // // I_Quit // + void I_Quit (void) { D_QuitNetGame (); @@ -191,16 +183,6 @@ void I_WaitVBL(int count) I_Sleep((count * 1000) / 70); } -byte* I_AllocLow(int length) -{ - byte* mem; - - mem = (byte *)malloc (length); - memset (mem,0,length); - return mem; -} - - // // I_Error // @@ -223,21 +205,40 @@ void I_Error (char *error, ...) } // Message first. - va_start (argptr,error); - fprintf (stderr, "Error: "); - vfprintf (stderr,error,argptr); - fprintf (stderr, "\n"); - va_end (argptr); - - fflush( stderr ); + va_start(argptr, error); + fprintf(stderr, "Error: "); + vfprintf(stderr, error, argptr); + fprintf(stderr, "\n"); + va_end(argptr); + fflush(stderr); // Shutdown. Here might be other errors. + if (demorecording) + { G_CheckDemoStatus(); + } D_QuitNetGame (); I_ShutdownGraphics(); + S_Shutdown(); - abort(); +#ifdef _WIN32 + // On Windows, pop up a dialog box with the error message. + { + char msgbuf[512]; + + va_start(argptr, error); + memset(msgbuf, 0, sizeof(msgbuf)); + vsnprintf(msgbuf, sizeof(msgbuf) - 1, error, argptr); + va_end(argptr); + + MessageBox(NULL, msgbuf, "Error", MB_OK); + } +#endif + + // abort(); + + exit(-1); } -- cgit v1.2.3