@@ -25,7 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2525
2626console_t con;
2727
28- cvar_t *con_notifytime;
28+ static cvar_t *con_notifytime;
29+ static cvar_t *con_image;
30+ static cvar_t *con_size;
2931
3032#define MAXCMDLINE 256
3133extern char key_lines[ 32 ][ MAXCMDLINE ];
@@ -102,7 +104,7 @@ void Con_ToggleConsole_f( void )
102104Con_ToggleChat_f
103105================
104106*/
105- void Con_ToggleChat_f ( void )
107+ static void Con_ToggleChat_f ()
106108{
107109 Key_ClearTyping ();
108110
@@ -125,7 +127,7 @@ void Con_ToggleChat_f( void )
125127Con_Clear_f
126128================
127129*/
128- void Con_Clear_f ( void ) { memset ( con.text , ' ' , CON_TEXTSIZE ); }
130+ void Con_Clear_f () { memset ( con.text , ' ' , CON_TEXTSIZE ); }
129131
130132/*
131133================
@@ -134,7 +136,7 @@ Con_Dump_f
134136Save the console contents out to a file
135137================
136138*/
137- void Con_Dump_f ( void )
139+ void Con_Dump_f ()
138140{
139141 int l, x;
140142 char *line;
@@ -194,7 +196,7 @@ void Con_Dump_f( void )
194196Con_ClearNotify
195197================
196198*/
197- void Con_ClearNotify ( void )
199+ void Con_ClearNotify ()
198200{
199201 int i;
200202
@@ -206,7 +208,7 @@ void Con_ClearNotify( void )
206208Con_MessageMode_f
207209================
208210*/
209- void Con_MessageMode_f ( void )
211+ void Con_MessageMode_f ()
210212{
211213 chat_team = false ;
212214 cls.key_dest = key_message;
@@ -217,7 +219,7 @@ void Con_MessageMode_f( void )
217219Con_MessageMode2_f
218220================
219221*/
220- void Con_MessageMode2_f ( void )
222+ void Con_MessageMode2_f ()
221223{
222224 chat_team = true ;
223225 cls.key_dest = key_message;
@@ -230,7 +232,7 @@ Con_CheckResize
230232If the line width has changed, reformat the buffer.
231233================
232234*/
233- void Con_CheckResize ( void )
235+ void Con_CheckResize ()
234236{
235237 int i, j, width, oldwidth, oldtotallines, numlines, numchars;
236238 char tbuf[ CON_TEXTSIZE ];
@@ -297,7 +299,9 @@ void Con_Init( void )
297299 //
298300 // register our commands
299301 //
300- con_notifytime = Cvar_Get ( " con_notifytime" , " 3" , 0 );
302+ con_notifytime = Cvar_Get ( " con_notifytime" , " 3" , CVAR_ARCHIVE );
303+ con_image = Cvar_Get ( " con_image" , " " , CVAR_ARCHIVE );
304+ con_size = Cvar_Get ( " con_size" , " 0.8" , CVAR_ARCHIVE );
301305
302306 Cmd_AddCommand ( " toggleconsole" , Con_ToggleConsole_f );
303307 Cmd_AddCommand ( " togglechat" , Con_ToggleChat_f );
@@ -527,23 +531,30 @@ Con_DrawConsole
527531Draws the console with the solid background
528532================
529533*/
530- void Con_DrawConsole ( float frac )
534+ void Con_DrawConsole ()
531535{
532536 int i, j, x, y, n;
533537 int rows;
534538 char *text;
535539 int row;
536- int lines;
537- char dlbar[ 1024 ];
538540
539- lines = viddef.height * frac;
541+ float frac = ( cls.state == ca_disconnected || cls.state == ca_connecting ) ? 1 .0f : con_size->value ;
542+
543+ int lines = viddef.height * frac;
540544 if ( lines <= 0 ) return ;
541545
542546 if ( lines > viddef.height ) lines = viddef.height ;
543547
544548 // draw the background
545- Draw_StretchPic ( 0 , -viddef.height + lines, viddef.width , viddef.height ,
546- " conback" );
549+ if ( *con_image->string != ' \0 ' )
550+ {
551+ Draw_StretchPic ( 0 , -viddef.height + lines, viddef.width , viddef.height , con_image->string );
552+ }
553+ else
554+ {
555+ Draw_Fill ( 0 , -viddef.height + lines, viddef.width , viddef.height , chr::ColourF32 ( 0 .0f , 0 .0f , 0 .0f , 0 .5f ) );
556+ }
557+
547558 SCR_AddDirtyPoint ( 0 , 0 );
548559 SCR_AddDirtyPoint ( viddef.width - 1 , lines - 1 );
549560
@@ -595,7 +606,8 @@ void Con_DrawConsole( float frac )
595606 // figure out width
596607 if ( cls.download )
597608 {
598- if ( ( text = strrchr ( cls.downloadname , ' /' ) ) != NULL )
609+ char dlbar[ 1024 ];
610+ if ( ( text = strrchr ( cls.downloadname , ' /' ) ) != nullptr )
599611 text++;
600612 else
601613 text = cls.downloadname ;
0 commit comments