[iortcw] 495/497: MP: Center limbo view instead of stretching when using fixed aspect

Simon McVittie smcv at debian.org
Fri Sep 8 10:38:04 UTC 2017


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

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 96df21cb1c584fe58a41d7604b4bae1bf97e25cf
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Fri Dec 25 04:33:27 2015 -0500

    MP: Center limbo view instead of stretching when using fixed aspect
---
 MP/code/cgame/cg_draw.c      |  2 +-
 MP/code/cgame/cg_drawtools.c | 14 ++++++++------
 MP/code/cgame/cg_view.c      |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/MP/code/cgame/cg_draw.c b/MP/code/cgame/cg_draw.c
index 7fc2594..17fce9c 100644
--- a/MP/code/cgame/cg_draw.c
+++ b/MP/code/cgame/cg_draw.c
@@ -3882,7 +3882,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
 		w = LIMBO_3D_W;
 		h = LIMBO_3D_H;
 
-		if ( cg_fixedAspect.integer ) { //FIXME:MAN-AT-ARMS...Use correct view
+		if ( cg_fixedAspect.integer ) {
 			CG_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER);
 		}
 
diff --git a/MP/code/cgame/cg_drawtools.c b/MP/code/cgame/cg_drawtools.c
index aab0561..790461e 100644
--- a/MP/code/cgame/cg_drawtools.c
+++ b/MP/code/cgame/cg_drawtools.c
@@ -67,7 +67,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) {
 		if (cg_horizontalPlacement == PLACE_STRETCH) {
 			// NERVE - SMF - hack to make images display properly in small view / limbo mode
 			if ( cg.limboMenu && cg.refdef.width ) {
-				float xscale = ( ( cg.refdef.width / cgs.screenXScaleStretch ) / 640.f );
+				float xscale = ( ( cg.refdef.width / cgs.screenXScaleStretch ) / 640.0 );
 
 				( *x ) = ( *x ) * xscale + ( cg.refdef.x / cgs.screenXScaleStretch );
 				( *w ) *= xscale;
@@ -80,9 +80,10 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) {
 		} else {
 			// NERVE - SMF - hack to make images display properly in small view / limbo mode
 			if ( cg.limboMenu && cg.refdef.width ) {
-				float xscale = ( ( cg.refdef.width / cgs.screenXScaleStretch ) / 640.f );
+				float limboxscale = ( 640.0 / 480.0 ) / ( (float)LIMBO_3D_W / (float)LIMBO_3D_H ); // Limbo is not quite 4:3
+				float xscale = ( ( cg.refdef.width / cgs.screenXScale ) / ( 640.0 * limboxscale ) );
 
-				( *x ) = ( *x ) * xscale + ( cg.refdef.x / cgs.screenXScaleStretch );
+				( *x ) = ( *x ) * xscale + ( cg.refdef.x / cgs.screenXScale ) - ( cgs.screenXBias / cgs.screenXScale);
 				( *w ) *= xscale;
 			}
 			// -NERVE - SMF
@@ -101,7 +102,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) {
 		if (cg_verticalPlacement == PLACE_STRETCH) {
 			// NERVE - SMF - hack to make images display properly in small view / limbo mode
 			if ( cg.limboMenu && cg.refdef.width ) {
-				float yscale = ( ( cg.refdef.height / cgs.screenYScaleStretch ) / 480.f );
+				float yscale = ( ( cg.refdef.height / cgs.screenYScaleStretch ) / 480.0 );
 
 				( *y ) = ( *y ) * yscale + ( cg.refdef.y / cgs.screenYScaleStretch );
 				( *h ) *= yscale;
@@ -113,9 +114,10 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) {
 		} else {
 			// NERVE - SMF - hack to make images display properly in small view / limbo mode
 			if ( cg.limboMenu && cg.refdef.width ) {
-				float yscale = ( ( cg.refdef.height / cgs.screenYScaleStretch ) / 480.f );
+				float limboyscale = ( 480.0 / 640.0 ) / ( (float)LIMBO_3D_H / (float)LIMBO_3D_W ); // Limbo is not quite 4:3
+				float yscale = ( ( cg.refdef.height / cgs.screenYScale ) / ( 480.0 * limboyscale ) );
 
-				( *y ) = ( *y ) * yscale + ( cg.refdef.y / cgs.screenYScaleStretch );
+				( *y ) = ( *y ) * yscale + ( cg.refdef.y / cgs.screenYScale ) - ( cgs.screenYBias / cgs.screenYScale);
 				( *h ) *= yscale;
 			}
 			// -NERVE - SMF
diff --git a/MP/code/cgame/cg_view.c b/MP/code/cgame/cg_view.c
index 77ab410..25d89c3 100644
--- a/MP/code/cgame/cg_view.c
+++ b/MP/code/cgame/cg_view.c
@@ -202,7 +202,7 @@ static void CG_CalcVrect( void ) {
 		w = LIMBO_3D_W;
 		h = LIMBO_3D_H;
 
-		if ( cg_fixedAspect.integer ) { //FIXME:MAN-AT-ARMS...Use correct view
+		if ( cg_fixedAspect.integer ) {
 			CG_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER);
 		}
 

-- 
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