]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
Factorized audio CD code
[xonotic/darkplaces.git] / console.c
index 21148248e1ccaf21ec9cc676e164f70877ca4ff1..a9661cff147a5c8e7f81997079ab47ffa59b596f 100644 (file)
--- a/console.c
+++ b/console.c
@@ -73,9 +73,6 @@ qboolean con_initialized;
 
 mempool_t *console_mempool;
 
-// scan lines to clear for notify lines
-int con_notifylines;
-
 extern void M_Menu_Main_f (void);
 
 /*
@@ -201,20 +198,13 @@ void Con_CheckResize (void)
 }
 
 
-/*
-================
-Con_Init
-================
-*/
-void Con_Init (void)
+void Con_InitLogging (void)
 {
 #define MAXGAMEDIRLEN 1000
        char temp[MAXGAMEDIRLEN+1];
        char *t2 = "/qconsole.log";
 
-       Cvar_RegisterVariable(&logfile);
        con_debuglog = COM_CheckParm("-condebug");
-
        if (con_debuglog)
        {
                if (strlen (fs_gamedir) < (MAXGAMEDIRLEN - strlen (t2)))
@@ -224,6 +214,16 @@ void Con_Init (void)
                }
                logfile.integer = 1;
        }
+}
+
+/*
+================
+Con_Init
+================
+*/
+void Con_Init (void)
+{
+       Cvar_RegisterVariable(&logfile);
 
        console_mempool = Mem_AllocPool("console");
        con_text = Mem_Alloc(console_mempool, CON_TEXTSIZE);
@@ -264,7 +264,7 @@ void Con_Linefeed (void)
 Con_Print
 
 Handles cursor positioning, line wrapping, etc
-All console printing must go through this in order to be logged to disk
+All console printing must go through this in order to be displayed
 If no console is visible, the notify window will pop up.
 ================
 */
@@ -319,7 +319,7 @@ void Con_Print (const char *txt)
                        {
                                if (con_notify.integer < 0)
                                        Cvar_SetValueQuick(&con_notify, 0);
-                               if (con_notifylines > MAX_NOTIFYLINES)
+                               if (con_notify.integer > MAX_NOTIFYLINES)
                                        Cvar_SetValueQuick(&con_notify, MAX_NOTIFYLINES);
                                if (con_notify.integer > 0)
                                        con_times[con_current % con_notify.integer] = realtime;
@@ -515,7 +515,7 @@ void Con_DrawNotify (void)
 
        if (con_notify.integer < 0)
                Cvar_SetValueQuick(&con_notify, 0);
-       if (con_notifylines > MAX_NOTIFYLINES)
+       if (con_notify.integer > MAX_NOTIFYLINES)
                Cvar_SetValueQuick(&con_notify, MAX_NOTIFYLINES);
        v = 0;
        for (i= con_current-con_notify.integer+1 ; i<=con_current ; i++)
@@ -561,9 +561,6 @@ void Con_DrawNotify (void)
                        v += 8;
                }
        }
-
-       if (con_notifylines < v)
-               con_notifylines = v;
 }
 
 /*
@@ -574,7 +571,6 @@ Draws the console with the solid background
 The typing input line at the bottom should only be drawn if typing is allowed
 ================
 */
-extern cvar_t scr_conalpha;
 extern char engineversion[40];
 void Con_DrawConsole (int lines)
 {
@@ -585,7 +581,10 @@ void Con_DrawConsole (int lines)
                return;
 
 // draw the background
-       DrawQ_Pic(0, lines - vid.conheight, "gfx/conback", vid.conwidth, vid.conheight, 1, 1, 1, scr_conalpha.value * lines / vid.conheight, 0);
+       if (scr_conbrightness.value >= 0.01f)
+               DrawQ_Pic(0, lines - vid.conheight, "gfx/conback", vid.conwidth, vid.conheight, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, scr_conalpha.value, 0);
+       else
+               DrawQ_Fill(0, lines - vid.conheight, vid.conwidth, vid.conheight, 0, 0, 0, scr_conalpha.value, 0);
        DrawQ_String(vid.conwidth - strlen(engineversion) * 8 - 8, lines - 8, engineversion, 0, 8, 8, 1, 0, 0, 1, 0);
 
 // draw the text