From 010c144fc0bd23e3c386478cdd0257c961172b54 Mon Sep 17 00:00:00 2001 From: perle Date: Mon, 29 Jul 2024 22:19:08 +0200 Subject: [PATCH] some more changes for 4TCTF --- engine/code/cgame/cg_draw.c | 139 ++++++++++++++++++------------ engine/code/cgame/cg_local.h | 2 +- engine/code/cgame/cg_main.c | 2 +- engine/code/cgame/cg_servercmds.c | 2 + engine/code/qcommon/q_shared.h | 2 +- q3rallycode.ppr | Bin 34061 -> 34265 bytes 6 files changed, 89 insertions(+), 58 deletions(-) diff --git a/engine/code/cgame/cg_draw.c b/engine/code/cgame/cg_draw.c index f56eaed3..92da4255 100644 --- a/engine/code/cgame/cg_draw.c +++ b/engine/code/cgame/cg_draw.c @@ -1359,7 +1359,7 @@ static float CG_DrawFPS( float y ) { s = va( "%ifps", fps ); w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH; - CG_DrawBigString( 635 - w, y + 2, s, 1.0F); + CG_DrawBigString( 622 - w, 355 + 2, s, 1.0F); } return y + BIGCHAR_HEIGHT + 4; @@ -1641,9 +1641,9 @@ float CG_DrawScores( float x, float y ) { if ( cgs.gametype >= GT_TEAM ) { CG_FillRect( x - 80, y, 96, 18, bgColor ); - - if (cgs.gametype >= GT_TEAM){ - // draw yellow + + // draw yellow + color[0] = 1.0f; color[1] = 1.0f; color[2] = 0.0f; @@ -1657,7 +1657,23 @@ float CG_DrawScores( float x, float y ) { } CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); + if ( cgs.gametype == GT_CTF ) { + // Display yellow flag status + item = BG_FindItemForPowerup( PW_YELLOWFLAG ); + + if (item) { + + y1 = y + TINYCHAR_HEIGHT + 8; + if( cgs.yellowflag >= 0 && cgs.yellowflag <= 2 ) { + + CG_DrawPic( x+1, y1+1, w-2, 16, cgs.media.yellowFlagShader[cgs.yellowflag] ); + + } + } + } + // draw green + color[0] = 0.0f; color[1] = 1.0f; color[2] = 0.0f; @@ -1670,71 +1686,84 @@ float CG_DrawScores( float x, float y ) { CG_DrawPic( x+1, y+1, w-2, 16, cgs.media.selectShader ); } CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); - } - color[0] = 0.0f; - color[1] = 0.0f; - color[2] = 1.0f; - color[3] = 0.33f; - s = va( "%2i", s2 ); - w = CG_DrawStrlen( s ) * TINYCHAR_WIDTH + 8; - x -= w; - - CG_FillRect( x+1, y+1, w-2, 16, color ); - if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) { - CG_DrawPic( x+1, y+1, w-2, 16, cgs.media.selectShader ); - - } - - CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); - - if ( cgs.gametype == GT_CTF ) { - // Display flag status - item = BG_FindItemForPowerup( PW_BLUEFLAG ); + if ( cgs.gametype == GT_CTF ) { + // Display green flag status + item = BG_FindItemForPowerup( PW_GREENFLAG ); if (item) { - y1 = y + TINYCHAR_HEIGHT + 8; - if( cgs.blueflag >= 0 && cgs.blueflag <= 2 ) { + y1 = y + TINYCHAR_HEIGHT + 8; + if( cgs.greenflag >= 0 && cgs.greenflag <= 2 ) { + + CG_DrawPic( x+1, y1+1, w-2, 16, cgs.media.greenFlagShader[cgs.greenflag] ); + + } + } + } + + // draw blue + + color[0] = 0.0f; + color[1] = 0.0f; + color[2] = 1.0f; + color[3] = 0.33f; + s = va( "%2i", s2 ); + w = CG_DrawStrlen( s ) * TINYCHAR_WIDTH + 8; + x -= w; + CG_FillRect( x+1, y+1, w-2, 16, color ); + if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) { + CG_DrawPic( x+1, y+1, w-2, 16, cgs.media.selectShader ); + } + CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); + + if ( cgs.gametype == GT_CTF ) { + // Display blue flag status + item = BG_FindItemForPowerup( PW_BLUEFLAG ); + + if (item) { + + y1 = y + TINYCHAR_HEIGHT + 8; + if( cgs.blueflag >= 0 && cgs.blueflag <= 2 ) { CG_DrawPic( x+1, y1+1, w-2, 16, cgs.media.blueFlagShader[cgs.blueflag] ); - } - } - } + } + } + } + + // draw red - color[0] = 1.0f; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 0.33f; - s = va( "%2i", s1 ); - w = CG_DrawStrlen( s ) * TINYCHAR_WIDTH + 8; - x -= w; + color[0] = 1.0f; + color[1] = 0.0f; + color[2] = 0.0f; + color[3] = 0.33f; + s = va( "%2i", s1 ); + w = CG_DrawStrlen( s ) * TINYCHAR_WIDTH + 8; + x -= w; + CG_FillRect( x+1, y+1, w-2, 16, color ); + if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) { + CG_DrawPic( x+1, y+1, w-2, 16, cgs.media.selectShader ); + } + CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); - CG_FillRect( x+1, y+1, w-2, 16, color ); - if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) { - - CG_DrawPic( x+1, y+1, w-2, 16, cgs.media.selectShader ); - - } - - CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F); - - if ( cgs.gametype == GT_CTF ) { - // Display flag status - item = BG_FindItemForPowerup( PW_REDFLAG ); + if ( cgs.gametype == GT_CTF ) { + // Display red flag status + item = BG_FindItemForPowerup( PW_REDFLAG ); if (item) { - y1 = y + TINYCHAR_HEIGHT + 8; + y1 = y + TINYCHAR_HEIGHT + 8; + if( cgs.redflag >= 0 && cgs.redflag <= 2 ) { - if( cgs.redflag >= 0 && cgs.redflag <= 2 ) { - - - } - } - } + CG_DrawPic( x+1, y1+1, w-2, 16, cgs.media.redFlagShader[cgs.redflag] ); + + } + } + } + + #ifdef MISSIONPACK if ( cgs.gametype == GT_1FCTF ) { // Display flag status diff --git a/engine/code/cgame/cg_local.h b/engine/code/cgame/cg_local.h index 104039a4..6f711c4c 100644 --- a/engine/code/cgame/cg_local.h +++ b/engine/code/cgame/cg_local.h @@ -1244,7 +1244,7 @@ typedef struct { // Q3Rally Code Start int scores3, scores4; // from configstrings // Q3Rally Code END - int redflag, blueflag; // flag status from configstrings + int redflag, blueflag, greenflag, yellowflag; // flag status from configstrings int flagStatus; int sigil[MAX_SIGILS]; qboolean newHud; diff --git a/engine/code/cgame/cg_main.c b/engine/code/cgame/cg_main.c index 7dec7aa2..ff6ccdef 100644 --- a/engine/code/cgame/cg_main.c +++ b/engine/code/cgame/cg_main.c @@ -2203,7 +2203,7 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) { cg.weaponSelect = WP_MACHINEGUN; - cgs.redflag = cgs.blueflag = -1; // For compatibily, default to unset for + cgs.redflag = cgs.blueflag = cgs.greenflag = cgs.yellowflag = -1; // For compatibily, default to unset for cgs.flagStatus = -1; // Q3Rally Code Start for ( i = 0; i < MAX_SIGILS; i++ ) { diff --git a/engine/code/cgame/cg_servercmds.c b/engine/code/cgame/cg_servercmds.c index f58bcbff..a504fa63 100644 --- a/engine/code/cgame/cg_servercmds.c +++ b/engine/code/cgame/cg_servercmds.c @@ -284,6 +284,8 @@ void CG_SetConfigValues( void ) { s = CG_ConfigString( CS_FLAGSTATUS ); cgs.redflag = s[0] - '0'; cgs.blueflag = s[1] - '0'; + cgs.greenflag = s[2] - '0'; + cgs.yellowflag = s[3] - '0'; } else if ( cgs.gametype == GT_DOMINATION ) { diff --git a/engine/code/qcommon/q_shared.h b/engine/code/qcommon/q_shared.h index cbf65dc7..3c6aeff3 100644 --- a/engine/code/qcommon/q_shared.h +++ b/engine/code/qcommon/q_shared.h @@ -70,7 +70,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define BASETA "missionpack" #ifndef PRODUCT_VERSION -#define PRODUCT_VERSION "v0.5 r606" +#define PRODUCT_VERSION "v0.5 r607" #endif diff --git a/q3rallycode.ppr b/q3rallycode.ppr index 7f0c3fa4bd23759ba9cf900fafd546b96c62e066..f237ab0eaca318ff69e9e1093abe81ca0adb2f3d 100644 GIT binary patch delta 219 zcmeC}V!GMQwBcnvvyq|gIoVQ*63g|H zCmS|s2^pK1@NzjP7NwTh8XM~v8k-qSKHnrhxuv0-(Q>jtqZPk_0ZiUf$I#Gl^1}wn z%|(r}%)*97hL$iXQv)4CBNOw<^IP&J8#jmnE#{Gr<>d;=FYw9COSLsJH-xD)G}1A$ lFz4lp202QjC^ap$C^auRwOB71Nxg+JOu2=zj->@J7XS@bLm2=7 delta 111 zcmccF&D7h)wBcp_WU~gd$$hmVlNU9KO`hB!BxG)2!pr5HSd>~~Yiy!pXl`UW`9YJ& zWI0*x$=4d18O@1)i!0Io_U AyZ`_I