]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
removed unused leaf parameter on CompleteLightPoint
[xonotic/darkplaces.git] / console.c
index f36ca203efcbf0022f690ba4bf4e682531863639..e6127a24add11f59abc65bc35f388ef83a68d67b 100644 (file)
--- a/console.c
+++ b/console.c
@@ -39,7 +39,7 @@ int con_backscroll;
 int con_current;
 // offset in current line for next print
 int con_x;
-char *con_text = 0;
+char con_text[CON_TEXTSIZE];
 
 //seconds
 cvar_t con_notifytime = {CVAR_SAVE, "con_notifytime","3"};
@@ -60,8 +60,6 @@ extern int key_insert;
 
 qboolean con_initialized;
 
-mempool_t *console_mempool;
-
 
 /*
 ==============================================================================
@@ -403,8 +401,6 @@ Con_Init
 */
 void Con_Init (void)
 {
-       console_mempool = Mem_AllocPool("console", 0, NULL);
-       con_text = Mem_Alloc(console_mempool, CON_TEXTSIZE);
        memset (con_text, ' ', CON_TEXTSIZE);
        con_linewidth = -1;
        Con_CheckResize ();
@@ -456,8 +452,6 @@ void Con_PrintToHistory(const char *txt)
        if (txt[0] == 1)
        {
                mask = 128;             // go to colored text
-               S_LocalSound ("sound/misc/talk.wav");
-       // play talk wav
                txt++;
        }
        else if (txt[0] == 2)
@@ -525,6 +519,11 @@ void Con_PrintToHistory(const char *txt)
                }
 
        }
+
+       if( txt[0] == 1 ) {
+               // play talk wav
+               S_LocalSound ("sound/misc/talk.wav");
+       }
 }
 
 /* The translation table between the graphical font and plain ASCII  --KB */
@@ -721,8 +720,8 @@ static void _Con_DrawString( float x, float y, const char *text, int maxlen, flo
                // iterate until we get the next color tag or reach the end of the text part to draw
                for( ; len && *last != _con_color_tag ; len--, last++ )
                        ;
-               // dont do anything if we havent read anything yet
-               if( last != text ) {
+               // only draw the partial string if we have read anything
+               if( last != first ) {
                        // draw the string
                        DrawQ_String( x, y, first, last - first, scalex, scaley, color[0], color[1], color[2], color[3], flags );
                        // update x to be at the new start position