From 397106f092d840ebf703c5057d4a06af81707bcd Mon Sep 17 00:00:00 2001 From: perle Date: Wed, 31 Jul 2024 23:30:42 +0200 Subject: [PATCH] # --- 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 | 12 +++ q3rallycode.ppr | Bin 32368 -> 34265 bytes 6 files changed, 100 insertions(+), 57 deletions(-) diff --git a/engine/code/cgame/cg_draw.c b/engine/code/cgame/cg_draw.c index b6271b44..49bd9635 100644 --- a/engine/code/cgame/cg_draw.c +++ b/engine/code/cgame/cg_draw.c @@ -1343,7 +1343,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; @@ -1625,9 +1625,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; @@ -1641,7 +1641,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; @@ -1654,71 +1670,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 8ae07e5b..54e45c2e 100644 --- a/engine/code/cgame/cg_local.h +++ b/engine/code/cgame/cg_local.h @@ -1242,7 +1242,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 bfa0a1de..e79b5e04 100644 --- a/engine/code/cgame/cg_main.c +++ b/engine/code/cgame/cg_main.c @@ -2193,7 +2193,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 df1e2c82..67a16209 100644 --- a/engine/code/qcommon/q_shared.h +++ b/engine/code/qcommon/q_shared.h @@ -70,7 +70,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define BASETA "missionpack" #ifndef PRODUCT_VERSION +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +#define PRODUCT_VERSION "v0.5 r607" +======= #define PRODUCT_VERSION "v0.5 r605" +>>>>>>> parent of c9856b0d (prepare new Gametype 4-Teams-CTF) +======= +#define PRODUCT_VERSION "v0.5 r605" +>>>>>>> parent of c9856b0d (prepare new Gametype 4-Teams-CTF) +======= +#define PRODUCT_VERSION "v0.5 r605" +>>>>>>> parent of c9856b0d (prepare new Gametype 4-Teams-CTF) #endif diff --git a/q3rallycode.ppr b/q3rallycode.ppr index 17201623d2affabe68de7f9d56a6eec897a8b2dc..f237ab0eaca318ff69e9e1093abe81ca0adb2f3d 100644 GIT binary patch delta 1406 zcmaKsL2DC16vr{e*lyk0Xj=+4Nv)I?9m>9$+0E=B7kg9@LA<1;Y&X+1Xf|~d>`A33 z4}vIr7V!fV1g~EF7=oXn_yIilX0|gODfYIL`Mo#)_ul{I_n%8Y-&MZu%~tQGy<{MZ zA9FXqy`BC3y!cp~_qusGxCV5vsAGBrG>t}K+9d_lG z(z%uNce;ZYOkczK>)qbYpg&6WHOf9}-YAai-UOg<_5HAc-zXZtr!9xdkDBv-_N<@v zMmiFeBjJyeyeG9hK=CSOER%sIbOntGK;0i!7FXy6O0jJe8;N}@e$CBHP?YuM-a=8` zoGISFii%IQsVUR3j-uAe)3)zD86G^q>f69L_r1*|m*X~L1Xx6UuY;pmYB&^&!9X$L zL8K5ITe0}suQ7AOLej#6erWx4j7|=qL2OYVKqH+-X+Nn|mt7Kqz>qNk0F(8Ob%09; zF-ktI0P!HkXS9d{?Qwe}by(^YLPJ8iddRST(;+zvP0|=k=2(AOm^GFQ3)_S+Bw=9S zH?HR#9=J^&Vkbg@$^Y+0H;~#ns6eJVcrMWTbbHyEbI5F$fa9CxoRx8p>yvKfEn&w* zIT3*N=qQ7t!T;eRX0@=GL|pp@xz*DAj_MF>xkz%M%2jKzZq~wKg}|E1VFE-XE_$%*Mxy(|De2&mD>+>DnC0PmwR?EnA(