@@ -517,6 +517,8 @@ DRAWING
517517==============================================================================
518518*/
519519
520+ extern cvar_t * cl_consoleScale ; // leilei - scale the console
521+
520522
521523/*
522524================
@@ -536,7 +538,7 @@ void Con_DrawInput (void) {
536538
537539 re .SetColor ( con .color );
538540
539- SCR_DrawSmallChar ( con .xadjust + 1 * SMALLCHAR_WIDTH , y , ']' );
541+ SCR_DrawSmallChar ( con .xadjust + 1 * SMALLCHAR_WIDTH , y , ']' , 2 );
540542
541543 Field_Draw ( & g_consoleField , con .xadjust + 2 * SMALLCHAR_WIDTH , y ,
542544 SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH , qtrue , qtrue );
@@ -587,7 +589,7 @@ void Con_DrawNotify (void)
587589 currentColor = (text [x ]>>8 ) % NUMBER_OF_COLORS ;
588590 re .SetColor ( g_color_table [currentColor ] );
589591 }
590- SCR_DrawSmallChar ( cl_conXOffset -> integer + con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , v , text [x ] & 0xff );
592+ SCR_DrawSmallChar ( cl_conXOffset -> integer + con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , v , text [x ] & 0xff , 2 );
591593 }
592594
593595 v += SMALLCHAR_HEIGHT ;
@@ -636,6 +638,17 @@ void Con_DrawSolidConsole( float frac ) {
636638 int currentColor ;
637639 vec4_t color ;
638640
641+ if (cl_consoleScale -> integer && (cls .glconfig .vidWidth > SCREEN_WIDTH ))
642+ {
643+ lines = SCREEN_HEIGHT * frac ;
644+ if (lines <= 0 )
645+ return ;
646+
647+ if (lines > SCREEN_HEIGHT )
648+ lines = SCREEN_HEIGHT ;
649+ }
650+ else
651+ {
639652 lines = cls .glconfig .vidHeight * frac ;
640653 if (lines <= 0 )
641654 return ;
@@ -646,6 +659,7 @@ void Con_DrawSolidConsole( float frac ) {
646659 // on wide screens, we will center the text
647660 con .xadjust = 0 ;
648661 SCR_AdjustFrom640 ( & con .xadjust , NULL , NULL , NULL );
662+ }
649663
650664 // draw the background
651665 y = frac * SCREEN_HEIGHT ;
@@ -667,26 +681,58 @@ void Con_DrawSolidConsole( float frac ) {
667681 }
668682 }
669683
670- color [0 ] = 1 ;
671- color [1 ] = 0 ;
672- color [2 ] = 0 ;
684+ // leilei - normalize our custom color for the line
685+ //color[0] = 1;
686+ //color[1] = 0; // was 1 pre-1.25
687+ //color[2] = 0;
688+
689+ // leilei - normalize from our custom console color and apply it to the line
690+ {
691+ float max ;
692+ float rgb [3 ];
693+
694+ rgb [0 ] = cl_consoleColor [0 ]-> value ;
695+ rgb [1 ] = cl_consoleColor [1 ]-> value ;
696+ rgb [2 ] = cl_consoleColor [2 ]-> value ;
697+
698+ max = rgb [0 ] + rgb [1 ] + rgb [2 ] / 3 ;
699+
700+ if (max > 0 )
701+ {
702+ color [0 ] = rgb [0 ] / max ;
703+ color [1 ] = rgb [1 ] / max ;
704+ color [2 ] = rgb [2 ] / max ;
705+ }
706+ }
707+
708+
673709 if ( !cl_consoleType -> integer )
674710 color [3 ] = 1 ;
675711 SCR_FillRect ( 0 , y , SCREEN_WIDTH , 2 , color );
676712
677713
678714 // draw the version number
679715
680- re .SetColor ( g_color_table [ColorIndex (COLOR_RED )] );
716+ re .SetColor ( g_color_table [ColorIndex (cl_consoleAccent -> integer )] );
681717
682718 i = strlen ( Q3_VERSION );
683719
684- for (x = 0 ; x < i ; x ++ ) {
685- SCR_DrawSmallChar ( cls .glconfig .vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH ,
686- lines - SMALLCHAR_HEIGHT , Q3_VERSION [x ] );
720+ if (cl_consoleScale -> integer && (cls .glconfig .vidWidth > SCREEN_WIDTH )){
721+ for (x = 0 ; x < i ; x ++ ) {
722+ SCR_DrawSmallChar ( SCREEN_WIDTH - ( i - x + 1 ) * SMALLCHAR_WIDTH ,
723+ lines - SMALLCHAR_HEIGHT , Q3_VERSION [x ], 1 );
724+ }
725+ }
726+ else
727+ {
728+ for (x = 0 ; x < i ; x ++ ) {
729+ SCR_DrawSmallChar ( cls .glconfig .vidWidth - ( i - x + 1 ) * SMALLCHAR_WIDTH ,
730+ lines - SMALLCHAR_HEIGHT , Q3_VERSION [x ], 0 );
731+ }
687732 }
688733
689734
735+
690736 // draw the text
691737 con .vislines = lines ;
692738 rows = (lines - SMALLCHAR_WIDTH )/SMALLCHAR_WIDTH ; // rows of text to draw
@@ -697,9 +743,9 @@ void Con_DrawSolidConsole( float frac ) {
697743 if (con .display != con .current )
698744 {
699745 // draw arrows to show the buffer is backscrolled
700- re .SetColor ( g_color_table [ColorIndex (COLOR_RED )] );
746+ re .SetColor ( g_color_table [ColorIndex (cl_consoleAccent -> integer )] );
701747 for (x = 0 ; x < con .linewidth ; x += 4 )
702- SCR_DrawSmallChar ( con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , y , '^' );
748+ SCR_DrawSmallChar ( con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , y , '^' , 2 );
703749 y -= SMALLCHAR_HEIGHT ;
704750 rows -- ;
705751 }
@@ -733,7 +779,7 @@ void Con_DrawSolidConsole( float frac ) {
733779 currentColor = (text [x ]>>8 ) % NUMBER_OF_COLORS ;
734780 re .SetColor ( g_color_table [currentColor ] );
735781 }
736- SCR_DrawSmallChar ( con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , y , text [x ] & 0xff );
782+ SCR_DrawSmallChar ( con .xadjust + (x + 1 )* SMALLCHAR_WIDTH , y , text [x ] & 0xff , 2 );
737783 }
738784 }
739785
0 commit comments