From d8f9599427c22b563d3c11a5ceb03cf355c4b732 Mon Sep 17 00:00:00 2001 From: P3rlE <97919909+P3rlE@users.noreply.github.com> Date: Mon, 7 Mar 2022 23:15:00 +0100 Subject: [PATCH] fixed hud and flag icon position --- engine/code/cgame/cg_draw.c | 36 ++++++------- engine/code/qcommon/q_shared.h | 2 +- q3rallycode.ppr | 92 ++-------------------------------- 3 files changed, 23 insertions(+), 107 deletions(-) diff --git a/engine/code/cgame/cg_draw.c b/engine/code/cgame/cg_draw.c index 2df5004a..9c80120f 100644 --- a/engine/code/cgame/cg_draw.c +++ b/engine/code/cgame/cg_draw.c @@ -786,15 +786,15 @@ static void CG_DrawRallyStatusBar( void ) { // draw ammo background value = ps->ammo[cent->currentState.weapon]; if ( value > -1 ) - CG_FillRect( 4, 476 - 32, 106, 32, bg_color ); + CG_FillRect( -20, 476 - 32, 106, 32, bg_color ); + + // health background + CG_FillRect( 106, 476 - 32, 106, 32, bg_color ); // armor background if ( ps->stats[ STAT_ARMOR ] ) -// CG_FillRect( 190, 476 - 68, 106, 32, bg_color ); - CG_FillRect( 256, 476 - 32, 106, 32, bg_color ); - // health background - CG_FillRect( 130, 476 - 32, 106, 32, bg_color ); + CG_FillRect( 232, 476 - 32, 106, 32, bg_color ); // rearammo background weapon = 0; @@ -808,7 +808,7 @@ static void CG_DrawRallyStatusBar( void ) { } if ( weapon ) - CG_FillRect( 4, 476 - 68, 106, 32, bg_color ); + CG_FillRect( 358, 476 - 32, 106, 32, bg_color ); // draw any 3D icons now, so the changes back to 2D are minimized if ( cent->currentState.weapon && cg_weapons[ cent->currentState.weapon ].ammoModel ) { @@ -816,7 +816,7 @@ static void CG_DrawRallyStatusBar( void ) { origin[1] = 0; origin[2] = 0; angles[YAW] = 270 * sin( cg.time / 1000.0 ); - CG_Draw3DModel( 10, 476 - 28, 26, 26, + CG_Draw3DModel( -14, 476 - 28, 26, 26, cg_weapons[ cent->currentState.weapon ].ammoModel, 0, origin, angles ); } @@ -834,18 +834,18 @@ static void CG_DrawRallyStatusBar( void ) { origin[1] = 0; origin[2] = 0; angles[YAW] = 270 * sin( cg.time / 1000.0 ); - CG_Draw3DModel( 136, 476 - 28, 26, 26, + CG_Draw3DModel( 112, 476 - 28, 26, 26, healthModel, 0, origin, angles ); } if (cg.predictedPlayerState.powerups[PW_REDFLAG]) - CG_DrawStatusBarFlag( 196 + 26, TEAM_RED); + CG_DrawStatusBarFlag( -70, TEAM_RED); else if (cg.predictedPlayerState.powerups[PW_BLUEFLAG]) - CG_DrawStatusBarFlag( 196 + 26, TEAM_BLUE); + CG_DrawStatusBarFlag( -70, TEAM_BLUE); else if (cg_entities[cg.snap->ps.clientNum].finishRaceTime && cg_entities[cg.snap->ps.clientNum].currentPosition == 1){ - CG_DrawStatusBarFlag( 196 + 26, -1); + CG_DrawStatusBarFlag( -70, -1); } if ( ps->stats[ STAT_ARMOR ] ) { @@ -854,7 +854,7 @@ static void CG_DrawRallyStatusBar( void ) { origin[2] = -10; angles[YAW] = 270 * sin( cg.time / 1000.0 ); // CG_Draw3DModel( 196, 476 - 64, 26, 26, - CG_Draw3DModel( 262, 476 - 28, 26, 26, + CG_Draw3DModel( 238, 476 - 28, 26, 26, cgs.media.armorModel, 0, origin, angles ); } @@ -882,7 +882,7 @@ static void CG_DrawRallyStatusBar( void ) { } trap_R_SetColor( colors[color] ); - CG_DrawField (52, 476 - 28, 3, value); + CG_DrawField (28, 476 - 28, 3, value); trap_R_SetColor( NULL ); // if we didn't draw a 3D icon, draw a 2D icon for ammo @@ -906,7 +906,7 @@ static void CG_DrawRallyStatusBar( void ) { origin[1] = 0; origin[2] = 0; angles[YAW] = 270 * sin( cg.time / 1000.0 ); - CG_Draw3DModel( 10, 476 - 64, 26, 26, + CG_Draw3DModel( 364, 476 - 32, 26, 26, cg_weapons[ weapon ].weaponModel, 0, origin, angles ); } @@ -926,7 +926,7 @@ static void CG_DrawRallyStatusBar( void ) { } trap_R_SetColor( colors[color] ); - CG_DrawField (52 + CHAR_WIDTH, 476 - 64, 2, value); + CG_DrawField (422, 476 - 28, 2, value); trap_R_SetColor( NULL ); // if we didn't draw a 3D icon, draw a 2D icon for ammo @@ -958,7 +958,7 @@ static void CG_DrawRallyStatusBar( void ) { } // stretch the health up when taking damage - CG_DrawField ( 178, 476 - 28, 3, value); + CG_DrawField ( 154, 476 - 28, 3, value); CG_ColorForHealth( hcolor ); trap_R_SetColor( hcolor ); @@ -970,7 +970,7 @@ static void CG_DrawRallyStatusBar( void ) { if (value > 0 ) { trap_R_SetColor( colors[0] ); // CG_DrawField ( 242, 476 - 64, 3, value); - CG_DrawField ( 304, 476 - 28, 3, value); + CG_DrawField ( 280, 476 - 28, 3, value); trap_R_SetColor( NULL ); // if we didn't draw a 3D icon, draw a 2D icon for armor if ( !cg_draw3dIcons.integer && cg_drawIcons.integer ) { @@ -1796,7 +1796,7 @@ static float CG_DrawRallyPowerups( float y ) { CG_FillRect( x, y, 106, 32, bg_color ); trap_R_SetColor( colors[color] ); - CG_DrawField( x + 52 + CHAR_WIDTH, y + 3, 2, sortedTime[ i ] / 1000 ); + CG_DrawField( x + 48 + CHAR_WIDTH, y + 3, 2, sortedTime[ i ] / 1000 ); t = ps->powerups[ sorted[i] ]; if ( t - cg.time >= POWERUP_BLINKS * POWERUP_BLINK_TIME ) { diff --git a/engine/code/qcommon/q_shared.h b/engine/code/qcommon/q_shared.h index cd6417db..0387724c 100644 --- a/engine/code/qcommon/q_shared.h +++ b/engine/code/qcommon/q_shared.h @@ -67,7 +67,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define BASETA "missionpack" #ifndef PRODUCT_VERSION -#define PRODUCT_VERSION "v0.4_r508" +#define PRODUCT_VERSION "v0.4_r509" #endif diff --git a/q3rallycode.ppr b/q3rallycode.ppr index d32ff9f9..4cc067bb 100644 --- a/q3rallycode.ppr +++ b/q3rallycode.ppr @@ -887,98 +887,14 @@ q3rallycode engine\resync_svn.sh engine\cross-make-mingw64.sh [Open project files] -0=engine\code\client\cl_main.c -1=engine\code\q3_ui\ui_video.c -2=engine\code\qcommon\q_shared.c -3=engine\code\renderercommon\tr_common.h -4=engine\code\renderergl1\tr_backend.c -5=engine\code\renderergl1\tr_image.c -6=engine\code\renderergl1\tr_init.c -7=engine\code\renderergl1\tr_local.h -8=engine\code\renderergl1\tr_model_iqm.c -9=engine\code\cgame\cg_info.c -10=engine\code\cgame\cg_scoreboard.c -11=engine\code\cgame\cg_event.c -12=engine\code\cgame\cg_view.c -13=engine\code\qcommon\q_shared.h -14=engine\code\cgame\cg_weapons.c -15=engine\code\cgame\cg_drawtools.c -16=engine\code\cgame\cg_local.h -17=engine\code\ui\ui_main.c -18=engine\code\ui\ui_shared.c -19=engine\code\cgame\cg_draw.c -20=engine\code\cgame\cg_main.c -21=engine\code\ui\ui_shared.h -22=engine\code\cgame\cg_newdraw.c +0=engine\code\qcommon\q_shared.h +1=engine\code\cgame\cg_draw.c [Selected Project Files] Main= Selected=engine\code\qcommon\q_shared.h -[engine\code\client\cl_main.c] -TopLine=3069 -Caret=3,3108 -[engine\code\q3_ui\ui_video.c] -TopLine=557 -Caret=35,575 -[engine\code\qcommon\q_shared.c] -TopLine=15 -Caret=16,27 -[engine\code\renderercommon\tr_common.h] -TopLine=63 -Caret=34,83 -[engine\code\renderergl1\tr_backend.c] -TopLine=782 -Caret=103,797 -[engine\code\renderergl1\tr_image.c] -TopLine=844 -Caret=67,869 -[engine\code\renderergl1\tr_init.c] -TopLine=1290 -Caret=28,1298 -[engine\code\renderergl1\tr_local.h] -TopLine=600 -Caret=42,632 -[engine\code\renderergl1\tr_model_iqm.c] -TopLine=157 -Caret=29,182 -[engine\code\cgame\cg_info.c] -TopLine=143 -Caret=102,176 -[engine\code\cgame\cg_scoreboard.c] -TopLine=404 -Caret=1,435 -[engine\code\cgame\cg_event.c] -TopLine=283 -Caret=42,300 -[engine\code\cgame\cg_view.c] -TopLine=522 -Caret=3,552 [engine\code\qcommon\q_shared.h] TopLine=49 Caret=35,70 -[engine\code\cgame\cg_weapons.c] -TopLine=1607 -Caret=110,1632 -[engine\code\cgame\cg_drawtools.c] -TopLine=95 -Caret=1,129 -[engine\code\cgame\cg_local.h] -TopLine=1608 -Caret=1,1623 -[engine\code\ui\ui_main.c] -TopLine=5130 -Caret=40,5154 -[engine\code\ui\ui_shared.c] -TopLine=322 -Caret=41,343 [engine\code\cgame\cg_draw.c] -TopLine=2087 -Caret=10,2108 -[engine\code\cgame\cg_main.c] -TopLine=295 -Caret=33,317 -[engine\code\ui\ui_shared.h] -TopLine=364 -Caret=5,389 -[engine\code\cgame\cg_newdraw.c] -TopLine=1145 -Caret=1,1160 +TopLine=1788 +Caret=23,1799