From: black Date: Sat, 13 Aug 2005 20:56:23 +0000 (+0000) Subject: Added colored string support to centerprint. X-Git-Tag: xonotic-v0.1.0preview~4653 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=ef23141bb91e4e7d6bc5b582398ae0aa62f95d04;p=xonotic%2Fdarkplaces.git Added colored string support to centerprint. Fixed the menu from dying a recursive death if PRVM_Crash crashes inside of the error handling function. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5573 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index f9f4fe22..3bfaa3e1 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -199,6 +199,7 @@ void SCR_DrawCenterString (void) int l; int x, y; int remaining; + int color; // the finale prints the characters one at a time if (cl.intermission) @@ -214,6 +215,7 @@ void SCR_DrawCenterString (void) else y = 48; + color = -1; do { // scan the width of the line @@ -225,7 +227,7 @@ void SCR_DrawCenterString (void) { if (remaining < l) l = remaining; - DrawQ_String(x, y, start, l, 8, 8, 1, 1, 1, 1, 0); + DrawQ_ColoredString(x, y, start, l, 8, 8, 1, 1, 1, 1, 0, &color); remaining -= l; if (remaining <= 0) return; diff --git a/menu.c b/menu.c index 337328ae..bf03a119 100644 --- a/menu.c +++ b/menu.c @@ -4612,6 +4612,7 @@ void MR_SetRouting (qboolean forceold); void MP_Error(const char *format, ...) { + static qboolean processingError = false; char errorstring[4096]; va_list argptr; @@ -4620,7 +4621,13 @@ void MP_Error(const char *format, ...) va_end (argptr); Con_Printf( "Menu_Error: %s\n", errorstring ); - PRVM_Crash(); + if( !processingError ) { + processingError = true; + PRVM_Crash(); + processingError = false; + } else { + Con_Printf( "Menu_Error: Recursive call to MP_Error (from PRVM_Crash)!\n" ); + } // fall back to the normal menu