[iortcw] 451/497: All: Some more placement and visual fixes
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 21c4a1f1b07c467a4ae02988b5676fa73fb45117 Author: MAN-AT-ARMS Date: Thu Dec 3 11:10:51 2015 -0500 All: Some more placement and visual fixes --- MP/code/cgame/cg_draw.c | 18 - MP/code/cgame/cg_weapons.c| 2 +- MP/code/ui/ui_main.c | 2 +- MP/code/ui/ui_shared.c| 47 ++- SP/code/cgame/cg_draw.c | 179 ++ SP/code/cgame/cg_drawtools.c | 1 - SP/code/cgame/cg_info.c | 2 +- SP/code/cgame/cg_newdraw.c| 14 SP/code/cgame/cg_scoreboard.c | 2 +- SP/code/cgame/cg_weapons.c| 10 +-- SP/code/ui/ui_main.c | 16 +++- SP/code/ui/ui_shared.c| 54 ++--- 12 files changed, 218 insertions(+), 129 deletions(-) diff --git a/MP/code/cgame/cg_draw.c b/MP/code/cgame/cg_draw.c index 32c0ddd..f2d00f8 100644 --- a/MP/code/cgame/cg_draw.c +++ b/MP/code/cgame/cg_draw.c @@ -1669,6 +1669,10 @@ static void CG_DrawBinocReticle( void ) { CG_DrawPic( 0, 0, 640, 480, cgs.media.binocShaderSimple ); } + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER); + } + CG_FillRect( 146, 239, 348, 1, color ); CG_FillRect( 188, 234, 1, 13, color ); // ll @@ -3445,7 +3449,12 @@ static void CG_ScreenFade( void ) { return; } - CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH); + CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + } else { + CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + } } else { t = ( float )msec * cg.fadeRate; @@ -3456,7 +3465,12 @@ static void CG_ScreenFade( void ) { } if ( color[ 3 ] ) { - CG_FillRect( 0, 0, 640, 480, color ); + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH); + CG_FillRect( 0, 0, 640, 480, color ); + } else { + CG_FillRect( 0, 0, 640, 480, color ); + } } } } diff --git a/MP/code/cgame/cg_weapons.c b/MP/code/cgame/cg_weapons.c index 7908a63..4c0a80a 100644 --- a/MP/code/cgame/cg_weapons.c +++ b/MP/code/cgame/cg_weapons.c @@ -2926,7 +2926,7 @@ void CG_DrawWeaponSelect( void ) { trap_R_SetColor( color ); if ( cg_fixedAspect.integer == 2 ) { - CG_SetScreenPlacement(PLACE_RIGHT, PLACE_BOTTOM); + CG_SetScreenPlacement(PLACE_RIGHT, PLACE_TOP); } //(SA) neither of these overlap the weapon selection area anymore, so let them stay diff --git a/MP/code/ui/ui_main.c b/MP/code/ui/ui_main.c index 00c002c..819d1a3 100644 --- a/MP/code/ui/ui_main.c +++ b/MP/code/ui/ui_main.c @@ -1745,7 +1745,7 @@ static void UI_DrawMapCinematic( rectDef_t *rect, float scale, vec4_t color, qbo if ( uiInfo.mapList[map].cinematic == -1 ) { uiInfo.mapList[map].cinematic = trap_CIN_PlayCinematic( va( "%s.roq", uiInfo.mapList[map].mapLoadName ), 0, 0, 0, 0, ( CIN_loop | CIN_silent ) ); } - if ( uiInfo.mapList[map].cinematic >= 0 ) { + if ( uiInfo.mapList[map].cinematic >= 0 ) { trap_CIN_RunCinematic( uiInfo.mapList[map].cinematic ); // FIXME:MAN-AT-ARMS Scale this trap_CIN_SetExtents( uiInfo.mapList[map].cinematic, rect->x, rect->y, rect->w, rect->h ); diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c index 8464b8d..252fd18 100644 --- a/MP/code/ui/ui_shared.c +++ b/MP/code/ui/ui_shared.c @@ -93,6 +93,7 @@ static qboolean Menu_OverActiveItem( menuDef_t *menu, float x, float y ); static char memoryPool[MEM_POOL_SIZE]; static int allocPoint, outOfMemory; +vmCvar_t ui_fixedAspect; static screenPlacement_e ui_horizontalPlacement = PLACE_CENTER; static screenPlacement_e ui_verticalPlacement = PLACE_CENTER; @@ -144,7 +145,6 @@ screenPlacement_e UI_GetScreenVerticalPlacement(void) return ui_verticalPlacement; } -vmCvar_t ui_fixedAspect; /* @@ -792,10 +792,24 @@ void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float fadeCycle fillRect.h -= w->borderSize + 1; } - // Make pillarbox/letterbox for 4:3 UI + // Make menus letterboxed if aspect is < 4:3 + if ( ui_fixedAspect.integer ) { +
[iortcw] 451/497: All: Some more placement and visual fixes
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 21c4a1f1b07c467a4ae02988b5676fa73fb45117 Author: MAN-AT-ARMS Date: Thu Dec 3 11:10:51 2015 -0500 All: Some more placement and visual fixes --- MP/code/cgame/cg_draw.c | 18 - MP/code/cgame/cg_weapons.c| 2 +- MP/code/ui/ui_main.c | 2 +- MP/code/ui/ui_shared.c| 47 ++- SP/code/cgame/cg_draw.c | 179 ++ SP/code/cgame/cg_drawtools.c | 1 - SP/code/cgame/cg_info.c | 2 +- SP/code/cgame/cg_newdraw.c| 14 SP/code/cgame/cg_scoreboard.c | 2 +- SP/code/cgame/cg_weapons.c| 10 +-- SP/code/ui/ui_main.c | 16 +++- SP/code/ui/ui_shared.c| 54 ++--- 12 files changed, 218 insertions(+), 129 deletions(-) diff --git a/MP/code/cgame/cg_draw.c b/MP/code/cgame/cg_draw.c index 32c0ddd..f2d00f8 100644 --- a/MP/code/cgame/cg_draw.c +++ b/MP/code/cgame/cg_draw.c @@ -1669,6 +1669,10 @@ static void CG_DrawBinocReticle( void ) { CG_DrawPic( 0, 0, 640, 480, cgs.media.binocShaderSimple ); } + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_CENTER, PLACE_CENTER); + } + CG_FillRect( 146, 239, 348, 1, color ); CG_FillRect( 188, 234, 1, 13, color ); // ll @@ -3445,7 +3449,12 @@ static void CG_ScreenFade( void ) { return; } - CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH); + CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + } else { + CG_FillRect( 0, 0, 640, 480, cg.fadeColor1 ); + } } else { t = ( float )msec * cg.fadeRate; @@ -3456,7 +3465,12 @@ static void CG_ScreenFade( void ) { } if ( color[ 3 ] ) { - CG_FillRect( 0, 0, 640, 480, color ); + if ( cg_fixedAspect.integer ) { + CG_SetScreenPlacement(PLACE_STRETCH, PLACE_STRETCH); + CG_FillRect( 0, 0, 640, 480, color ); + } else { + CG_FillRect( 0, 0, 640, 480, color ); + } } } } diff --git a/MP/code/cgame/cg_weapons.c b/MP/code/cgame/cg_weapons.c index 7908a63..4c0a80a 100644 --- a/MP/code/cgame/cg_weapons.c +++ b/MP/code/cgame/cg_weapons.c @@ -2926,7 +2926,7 @@ void CG_DrawWeaponSelect( void ) { trap_R_SetColor( color ); if ( cg_fixedAspect.integer == 2 ) { - CG_SetScreenPlacement(PLACE_RIGHT, PLACE_BOTTOM); + CG_SetScreenPlacement(PLACE_RIGHT, PLACE_TOP); } //(SA) neither of these overlap the weapon selection area anymore, so let them stay diff --git a/MP/code/ui/ui_main.c b/MP/code/ui/ui_main.c index 00c002c..819d1a3 100644 --- a/MP/code/ui/ui_main.c +++ b/MP/code/ui/ui_main.c @@ -1745,7 +1745,7 @@ static void UI_DrawMapCinematic( rectDef_t *rect, float scale, vec4_t color, qbo if ( uiInfo.mapList[map].cinematic == -1 ) { uiInfo.mapList[map].cinematic = trap_CIN_PlayCinematic( va( "%s.roq", uiInfo.mapList[map].mapLoadName ), 0, 0, 0, 0, ( CIN_loop | CIN_silent ) ); } - if ( uiInfo.mapList[map].cinematic >= 0 ) { + if ( uiInfo.mapList[map].cinematic >= 0 ) { trap_CIN_RunCinematic( uiInfo.mapList[map].cinematic ); // FIXME:MAN-AT-ARMS Scale this trap_CIN_SetExtents( uiInfo.mapList[map].cinematic, rect->x, rect->y, rect->w, rect->h ); diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c index 8464b8d..252fd18 100644 --- a/MP/code/ui/ui_shared.c +++ b/MP/code/ui/ui_shared.c @@ -93,6 +93,7 @@ static qboolean Menu_OverActiveItem( menuDef_t *menu, float x, float y ); static char memoryPool[MEM_POOL_SIZE]; static int allocPoint, outOfMemory; +vmCvar_t ui_fixedAspect; static screenPlacement_e ui_horizontalPlacement = PLACE_CENTER; static screenPlacement_e ui_verticalPlacement = PLACE_CENTER; @@ -144,7 +145,6 @@ screenPlacement_e UI_GetScreenVerticalPlacement(void) return ui_verticalPlacement; } -vmCvar_t ui_fixedAspect; /* @@ -792,10 +792,24 @@ void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float fadeCycle fillRect.h -= w->borderSize + 1; } - // Make pillarbox/letterbox for 4:3 UI + // Make menus letterboxed if aspect is < 4:3 + if ( ui_fixedAspect.integer ) { +