[iortcw] 32/89: All: Scale the fadebox in UI when using cg_fixedAspect 2 (wide)

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit 87b51011d43facf2cdb86ca4e67259b219ea486f
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Mon Jul 10 13:26:48 2017 -0400

    All: Scale the fadebox in UI when using cg_fixedAspect 2 (wide)
---
 MP/code/ui/ui_shared.c | 16 ++++++++++++++--
 SP/code/ui/ui_shared.c | 16 ++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c
index ca40216..31128c1 100644
--- a/MP/code/ui/ui_shared.c
+++ b/MP/code/ui/ui_shared.c
@@ -793,8 +793,20 @@ void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float fadeCycle
 		if ( w->background ) {
 			Fade( &w->flags, &w->backColor[3], fadeClamp, &w->nextTime, fadeCycle, qtrue, fadeAmount );
 			DC->setColor( w->backColor );
-			DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
-			DC->setColor( NULL );
+			if ( ui_fixedAspect.integer == 2 ) {
+				if ( DC->glconfig.vidWidth * 480 > DC->glconfig.vidHeight * 640 ) {
+					// HACK ... stretch fadebox when using widescreen
+					if ( !Q_stricmpn( w->name, "fadebox", 7 ) ) {
+						UI_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH);
+						DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
+						DC->setColor( NULL );
+					}
+				}
+				UI_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER);
+			} else {
+				DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
+				DC->setColor( NULL );
+			}
 		} else {
 			DC->fillRect( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->backColor );
 		}
diff --git a/SP/code/ui/ui_shared.c b/SP/code/ui/ui_shared.c
index 5fff5c4..c2a0450 100644
--- a/SP/code/ui/ui_shared.c
+++ b/SP/code/ui/ui_shared.c
@@ -846,8 +846,20 @@ void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float fadeCycle
 		if ( w->background ) {
 			Fade( &w->flags, &w->backColor[3], fadeClamp, &w->nextTime, fadeCycle, qtrue, fadeAmount );
 			DC->setColor( w->backColor );
-			DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
-			DC->setColor( NULL );
+			if ( ui_fixedAspect.integer == 2 ) {
+				if ( DC->glconfig.vidWidth * 480 > DC->glconfig.vidHeight * 640 ) {
+					// HACK ... stretch fadebox when using widescreen
+					if ( !Q_stricmpn( w->name, "fadebox", 7 ) ) {
+						UI_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH);
+						DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
+						DC->setColor( NULL );
+					}
+				}
+				UI_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER);
+			} else {
+				DC->drawHandlePic( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background );
+				DC->setColor( NULL );
+			}
 		} else {
 			DC->fillRect( fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->backColor );
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list