Index: code/client/cl_console.c =================================================================== --- code/client/cl_console.c (revision 582) +++ code/client/cl_console.c (working copy) @@ -42,6 +42,7 @@ int totallines; // total lines in console scrollback float xadjust; // for wide aspect screens + float yadjust; // for narrow aspect screens float displayFrac; // aproaches finalFrac at scr_conspeed float finalFrac; // 0.0 to 1.0 lines of console to display @@ -486,10 +487,12 @@ re.SetColor( con.color ); - SCR_DrawSmallChar( con.xadjust + 1 * SMALLCHAR_WIDTH, y, ']' ); + if ( y >= con.yadjust ) { + SCR_DrawSmallChar( con.xadjust + 1 * SMALLCHAR_WIDTH, y, ']' ); - Field_Draw( &g_consoleField, con.xadjust + 2 * SMALLCHAR_WIDTH, y, - SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue ); + Field_Draw( &g_consoleField, con.xadjust + 2 * SMALLCHAR_WIDTH, + y, SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue ); + } } @@ -597,12 +600,13 @@ // on wide screens, we will center the text con.xadjust = 0; - SCR_AdjustFrom640( &con.xadjust, NULL, NULL, NULL ); + con.yadjust = 0; + SCR_AdjustFrom640( &con.xadjust, &con.yadjust, NULL, NULL ); // draw the background y = frac * SCREEN_HEIGHT - 2; - if ( y < 1 ) { - y = 0; + if ( y < con.yadjust ) { + y = con.yadjust; } else { SCR_DrawPic( 0, 0, SCREEN_WIDTH, y, cls.consoleShader ); @@ -622,11 +626,13 @@ i = strlen( Q3_VERSION ); for (x=0 ; x= con.yadjust ) { + SCR_DrawSmallChar( cls.glconfig.vidWidth - con.xadjust - ( i - x ) * SMALLCHAR_WIDTH, y , Q3_VERSION[x] ); + } - (lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), Q3_VERSION[x] ); - } @@ -641,10 +647,12 @@ { // draw arrows to show the buffer is backscrolled re.SetColor( g_color_table[ColorIndex(COLOR_RED)] ); - for (x=0 ; x= con.yadjust ) { + for (x=0 ; x= con.totallines) { // past scrollback wrap point Index: code/client/cl_scrn.c =================================================================== --- code/client/cl_scrn.c (revision 582) +++ code/client/cl_scrn.c (working copy) @@ -59,22 +59,26 @@ void SCR_AdjustFrom640( float *x, float *y, float *w, float *h ) { float xscale; float yscale; + float xbias = 0.0; + float ybias = 0.0; -#if 0 - // adjust for wide screens - if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) { - *x += 0.5 * ( cls.glconfig.vidWidth - ( cls.glconfig.vidHeight * 640 / 480 ) ); - } -#endif + xscale = cls.glconfig.vidWidth / 640.0; + yscale = cls.glconfig.vidHeight / 480.0; + if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) { + xbias = 0.5 * ( cls.glconfig.vidWidth - ( cls.glconfig.vidHeight * 640 / 480 ) ); + xscale = yscale; + } else if ( cls.glconfig.vidWidth * 480 < cls.glconfig.vidHeight * 640 ) { + ybias = 0.5 * ( cls.glconfig.vidHeight - ( cls.glconfig.vidWidth * 480.0 / 640.0 ) ); + yscale = xscale; + } + // scale for screen sizes - xscale = cls.glconfig.vidWidth / 640.0; - yscale = cls.glconfig.vidHeight / 480.0; if ( x ) { - *x *= xscale; + *x = xbias + *x * xscale; } if ( y ) { - *y *= yscale; + *y = ybias + *y * yscale; } if ( w ) { *w *= xscale; Index: code/client/cl_keys.c =================================================================== --- code/client/cl_keys.c (revision 582) +++ code/client/cl_keys.c (working copy) @@ -207,6 +207,11 @@ drawLen = edit->widthInChars; len = strlen( edit->buffer ) + 1; + // draw only inside given width + if ( drawLen * SMALLCHAR_WIDTH > width ) { + drawLen = width / SMALLCHAR_WIDTH; + } + // guarantee that cursor will be visible if ( len <= drawLen ) { prestep = 0; @@ -219,13 +224,11 @@ } prestep = edit->scroll; -/* if ( edit->cursor < len - drawLen ) { prestep = edit->cursor; // cursor at start } else { prestep = len - drawLen; } -*/ } if ( prestep + drawLen > len ) {