]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed scr_conlines to be a local variable named conlines
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:23:32 +0000 (06:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:23:32 +0000 (06:23 +0000)
now draws fullscreen console (between levels) without altering scr_con_current

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4922 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
screen.h

index d34f838ae8e0b8ee89a4fc42f6a72e34a5cfc7ca..7051d0bf19a85c43bc95b06adc75805c3bd5c4c5 100644 (file)
@@ -34,7 +34,6 @@ int jpeg_supported = false;
 qboolean       scr_initialized;                // ready to draw
 
 float          scr_con_current;
-float          scr_conlines;           // lines of console to display
 
 extern int     con_vislines;
 
@@ -234,6 +233,9 @@ SCR_SetUpToDrawConsole
 */
 void SCR_SetUpToDrawConsole (void)
 {
+       // lines of console to display
+       float conlines;
+
        Con_CheckResize ();
 
        if (key_dest == key_game && cls.signon != SIGNONS && scr_conforcewhiledisconnected.integer)
@@ -242,31 +244,29 @@ void SCR_SetUpToDrawConsole (void)
                key_consoleactive &= ~KEY_CONSOLEACTIVE_FORCED;
 
 // decide on the height of the console
-       if (key_consoleactive & KEY_CONSOLEACTIVE_FORCED)
-               scr_conlines = vid.conheight; // full screen
-       else if (key_consoleactive & KEY_CONSOLEACTIVE_USER)
-               scr_conlines = vid.conheight/2; // half screen
+       if (key_consoleactive & KEY_CONSOLEACTIVE_USER)
+               conlines = vid.conheight/2;     // half screen
        else
-               scr_conlines = 0;                               // none visible
+               conlines = 0;                           // none visible
 
        if (scr_conspeed.value)
        {
-               if (scr_conlines < scr_con_current)
+               if (scr_con_current > conlines)
                {
                        scr_con_current -= scr_conspeed.value*host_realframetime;
-                       if (scr_conlines > scr_con_current)
-                               scr_con_current = scr_conlines;
+                       if (scr_con_current < conlines)
+                               scr_con_current = conlines;
 
                }
-               else if (scr_conlines > scr_con_current)
+               else if (scr_con_current < conlines)
                {
                        scr_con_current += scr_conspeed.value*host_realframetime;
-                       if (scr_conlines < scr_con_current)
-                               scr_con_current = scr_conlines;
+                       if (scr_con_current > conlines)
+                               scr_con_current = conlines;
                }
        }
        else
-               scr_con_current = scr_conlines;
+               scr_con_current = conlines;
 }
 
 /*
@@ -276,7 +276,12 @@ SCR_DrawConsole
 */
 void SCR_DrawConsole (void)
 {
-       if (scr_con_current)
+       if (key_consoleactive & KEY_CONSOLEACTIVE_FORCED)
+       {
+               // full screen
+               Con_DrawConsole (vid.conheight);
+       }
+       else if (scr_con_current)
                Con_DrawConsole (scr_con_current);
        else
        {
index bb7ba5b90c7a8a594a8650591b07533a6ecdc29b..b479bc45396cb01ed8fecd9c5bc7e546d701dab9 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -28,8 +28,7 @@ void SCR_CenterPrint(char *str);
 
 void SCR_BeginLoadingPlaque (void);
 
-extern float scr_con_current;
-extern float scr_conlines; // lines of console to display
+extern float scr_con_current; // current height of displayed console
 
 extern int sb_lines;