From 55b4bc86931ce7bcf67ece4556705bc809e97c7f Mon Sep 17 00:00:00 2001 From: zturtleman Date: Fri, 18 Feb 2011 22:17:13 +0000 Subject: [PATCH] - Stretch backgrounds to fit screen in widescreen, I think it looks nicer. --- engine/code/q3_ui/ui_atoms.c | 15 ++++++++------- engine/code/q3_ui/ui_credits.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/engine/code/q3_ui/ui_atoms.c b/engine/code/q3_ui/ui_atoms.c index 1e7b94e8..c2fd781b 100644 --- a/engine/code/q3_ui/ui_atoms.c +++ b/engine/code/q3_ui/ui_atoms.c @@ -1537,10 +1537,10 @@ void UI_Refresh( int realtime ) { // draw the background if( uis.activemenu->showlogo ) { - UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackShader ); + UI_DrawHandlePic( -uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, uis.menuBackShader ); } else { - UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackNoLogoShader ); + UI_DrawHandlePic( -uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, uis.menuBackNoLogoShader ); } } @@ -1548,10 +1548,11 @@ void UI_Refresh( int realtime ) if (uis.menusp > 1){ // draw the background pic if (uis.stack[uis.menusp-2]->fullscreen){ - if( uis.stack[uis.menusp-2]->showlogo ) - UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackShader ); - else - UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackNoLogoShader ); + if( uis.stack[uis.menusp-2]->showlogo ) { + UI_DrawHandlePic( -uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, uis.menuBackShader ); + } else { + UI_DrawHandlePic( -uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, uis.menuBackNoLogoShader ); + } } // draw the background menu @@ -1561,7 +1562,7 @@ void UI_Refresh( int realtime ) Menu_Draw( uis.stack[uis.menusp-2] ); // dim the background menu - UI_FillRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, menu_back_color ); + UI_FillRect( -uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, menu_back_color ); } } diff --git a/engine/code/q3_ui/ui_credits.c b/engine/code/q3_ui/ui_credits.c index 293547bd..1d064573 100644 --- a/engine/code/q3_ui/ui_credits.c +++ b/engine/code/q3_ui/ui_credits.c @@ -224,11 +224,11 @@ static void ScrollingCredits_Draw(void) // first, fill the background with the specified colour/shader // we are drawing a shader #ifdef BACKGROUND_SHADER - UI_DrawHandlePic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, BackgroundShader); + UI_DrawHandlePic(-uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, BackgroundShader); #else // we are just filling a color - UI_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color_background); + UI_FillRect(-uis.bias, 0, SCREEN_WIDTH+uis.bias*2, SCREEN_HEIGHT, color_background); #endif