]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Added colored string support to centerprint.
authorblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 13 Aug 2005 20:56:23 +0000 (20:56 +0000)
committerblack <black@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 13 Aug 2005 20:56:23 +0000 (20:56 +0000)
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

cl_screen.c
menu.c

index f9f4fe2219543442624467fb83b5bf1fbadd2507..3bfaa3e1a41dadc589c0644814c2a7122bff8c1a 100644 (file)
@@ -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 337328aecfb65b0af8c17c298b00c740df1b2c13..bf03a1192b25a657c8748486d258f2d3858ad9bf 100644 (file)
--- 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