From d4d94bd63dc50cdb68eb89496b25dd1260435ed9 Mon Sep 17 00:00:00 2001 From: q3rally Date: Thu, 8 Jul 2021 09:31:01 +0000 Subject: [PATCH] Added the new sigils and icons from insellium codewise version upcount --- engine/code/cgame/cg_draw.c | 29 ++++++++++-------- engine/code/cgame/cg_local.h | 7 ++++- engine/code/cgame/cg_main.c | 17 +++++++---- engine/code/cgame/cg_servercmds.c | 6 +++- engine/code/game/bg_misc.c | 50 +++++++++++++++++-------------- engine/code/game/g_team.c | 18 +++++++++-- engine/code/qcommon/q_shared.h | 4 +-- q3rallycode.ppr | 30 +++++++++---------- 8 files changed, 99 insertions(+), 62 deletions(-) diff --git a/engine/code/cgame/cg_draw.c b/engine/code/cgame/cg_draw.c index 750076c0..a463c7c0 100644 --- a/engine/code/cgame/cg_draw.c +++ b/engine/code/cgame/cg_draw.c @@ -534,16 +534,15 @@ void CG_DrawTeamBackground( int x, int y, int w, int h, float alpha, int team ) CG_DrawSigilHUD ======================= */ + void CG_DrawSigilHUD( void ) { - int i, x=480, y=0; + + int i, x=440, y=0; for (i=0; ilerpOrigin,end); if (target->currentState.modelindex == redSigil) - CG_DrawSigilLocationInfo(origin, end, cgs.media.redFlagShader[0], colorRed); + CG_DrawSigilLocationInfo(origin, end, cgs.media.redsigilShader, colorRed); else if (target->currentState.modelindex == blueSigil) - CG_DrawSigilLocationInfo(origin, end, cgs.media.blueFlagShader[0], colorBlue); + CG_DrawSigilLocationInfo(origin, end, cgs.media.bluesigilShader, colorBlue); else if (target->currentState.modelindex == greenSigil) - CG_DrawSigilLocationInfo(origin, end, cgs.media.greenFlagShader[0], colorGreen); + CG_DrawSigilLocationInfo(origin, end, cgs.media.greensigilShader, colorGreen); else if (target->currentState.modelindex == yellowSigil) - CG_DrawSigilLocationInfo(origin, end, cgs.media.yellowFlagShader[0], colorYellow); + CG_DrawSigilLocationInfo(origin, end, cgs.media.yellowsigilShader, colorYellow); else if (target->currentState.modelindex == whiteSigil) CG_DrawSigilLocationInfo(origin, end, cgs.media.sigilShader, colorWhite); diff --git a/engine/code/cgame/cg_local.h b/engine/code/cgame/cg_local.h index a34767de..f10b4e7e 100644 --- a/engine/code/cgame/cg_local.h +++ b/engine/code/cgame/cg_local.h @@ -841,13 +841,18 @@ typedef struct { qhandle_t greenFlagModel; qhandle_t yellowFlagModel; qhandle_t neutralFlagModel; + qhandle_t redSigilModel; + qhandle_t blueSigilModel; + qhandle_t greenSigilModel; + qhandle_t yellowSigilModel; + qhandle_t neutralSigilModel; qhandle_t redFlagShader[3]; qhandle_t blueFlagShader[3]; qhandle_t greenFlagShader[3]; qhandle_t yellowFlagShader[3]; qhandle_t flagShader[4]; // Q3Rally Code Start - qhandle_t sigilShader; + qhandle_t sigilShader; qhandle_t redsigilShader; qhandle_t bluesigilShader; qhandle_t greensigilShader; diff --git a/engine/code/cgame/cg_main.c b/engine/code/cgame/cg_main.c index 13bf6bfe..2674e106 100644 --- a/engine/code/cgame/cg_main.c +++ b/engine/code/cgame/cg_main.c @@ -1098,6 +1098,11 @@ static void CG_RegisterGraphics( void ) { cgs.media.blueFlagModel = trap_R_RegisterModel( "models/flags/b_flag.md3" ); cgs.media.greenFlagModel = trap_R_RegisterModel( "models/flags/g_flag.md3" ); cgs.media.yellowFlagModel = trap_R_RegisterModel( "models/flags/y_flag.md3" ); + cgs.media.redSigilModel = trap_R_RegisterModel( "models/flags/r_sigil.md3" ); + cgs.media.blueSigilModel = trap_R_RegisterModel( "models/flags/b_sigil.md3" ); + cgs.media.greenSigilModel = trap_R_RegisterModel( "models/flags/g_sigil.md3" ); + cgs.media.yellowSigilModel = trap_R_RegisterModel( "models/flags/y_sigil.md3" ); + cgs.media.neutralSigilModel = trap_R_RegisterModel( "models/flags/n_sigil.md3" ); cgs.media.redFlagShader[0] = trap_R_RegisterShaderNoMip( "icons/iconf_red1" ); cgs.media.redFlagShader[1] = trap_R_RegisterShaderNoMip( "icons/iconf_red2" ); cgs.media.redFlagShader[2] = trap_R_RegisterShaderNoMip( "icons/iconf_red3" ); @@ -1111,11 +1116,11 @@ static void CG_RegisterGraphics( void ) { cgs.media.yellowFlagShader[1] = trap_R_RegisterShaderNoMip( "icons/iconf_yell2" ); cgs.media.yellowFlagShader[2] = trap_R_RegisterShaderNoMip( "icons/iconf_yell3" ); // Q3Rally Code Start - cgs.media.sigilShader = trap_R_RegisterShaderNoMip( "icons/iconf_neutral1" ); - cgs.media.redsigilShader = trap_R_RegisterShaderNoMip( "icons/iconf_red1" ); - cgs.media.bluesigilShader = trap_R_RegisterShaderNoMip( "icons/iconf_blu1" ); - cgs.media.greensigilShader = trap_R_RegisterShaderNoMip( "icons/iconf_green1" ); - cgs.media.yellowsigilShader = trap_R_RegisterShaderNoMip( "icons/iconf_yell1" ); + cgs.media.sigilShader = trap_R_RegisterShaderNoMip( "icons/icons_neutral" ); + cgs.media.redsigilShader = trap_R_RegisterShaderNoMip( "icons/icons_red" ); + cgs.media.bluesigilShader = trap_R_RegisterShaderNoMip( "icons/icons_blu" ); + cgs.media.greensigilShader = trap_R_RegisterShaderNoMip( "icons/icons_green" ); + cgs.media.yellowsigilShader = trap_R_RegisterShaderNoMip( "icons/icons_yellow" ); // Q3Rally Code END #ifdef MISSIONPACK @@ -2182,7 +2187,7 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) { cgs.redflag = cgs.blueflag = -1; // For compatibily, default to unset for cgs.flagStatus = -1; // Q3Rally Code Start - cgs.sigil[0] = cgs.sigil[1] = cgs.sigil[2] = -1; // Sigil Reset + cgs.sigil[0] = cgs.sigil[1] = cgs.sigil[2] = cgs.sigil[3] = cgs.sigil[4] = -1; // Sigil Reset // Q3Rally Code END // old servers diff --git a/engine/code/cgame/cg_servercmds.c b/engine/code/cgame/cg_servercmds.c index 006f54ec..87e3afd5 100644 --- a/engine/code/cgame/cg_servercmds.c +++ b/engine/code/cgame/cg_servercmds.c @@ -269,6 +269,8 @@ void CG_SetConfigValues( void ) { cgs.sigil[0] = s[0] - '0'; cgs.sigil[1] = s[1] - '0'; cgs.sigil[2] = s[2] - '0'; + cgs.sigil[3] = s[3] - '0'; + cgs.sigil[4] = s[4] - '0'; } #ifdef MISSIONPACK @@ -415,6 +417,8 @@ static void CG_ConfigStringModified( void ) { cgs.sigil[0] = str[0] - '0'; cgs.sigil[1] = str[1] - '1'; cgs.sigil[2] = str[2] - '2'; + cgs.sigil[3] = str[3] - '3'; + cgs.sigil[4] = str[4] - '4'; } } else if ( num == CS_SHADERSTATE ) { @@ -448,7 +452,7 @@ static void CG_AddToTeamChat( const char *str ) { return; } - len = 0; + p = cgs.teamChatMsgs[cgs.teamChatPos % chatHeight]; *p = 0; diff --git a/engine/code/game/bg_misc.c b/engine/code/game/bg_misc.c index 39a7f8ac..db79932f 100644 --- a/engine/code/game/bg_misc.c +++ b/engine/code/game/bg_misc.c @@ -791,7 +791,7 @@ gitem_t bg_itemlist[] = /* pickup */ "Invisibility", 30, IT_POWERUP, - PW_INVIS, + PW_INVIS, /* precache */ "", /* sounds */ "" }, @@ -898,10 +898,10 @@ Only in Domination games { "team_DOMINATION_sigil_red", NULL, - { "models/flags/r_flag.md3", + { "models/flags/r_sigil.md3", 0, 0, 0 }, -/* icon */ "icons/iconf_red1", -/* pickup */ "Flag", +/* icon */ "icons/icons_red", +/* pickup */ "Sigil", 0, IT_SIGIL, PW_SIGILRED, @@ -915,10 +915,10 @@ Only in Domination games { "team_DOMINATION_sigil_blue", NULL, - { "models/flags/b_flag.md3", + { "models/flags/b_sigil.md3", 0, 0, 0 }, -/* icon */ "icons/iconf_blu1", -/* pickup */ "Flag", +/* icon */ "icons/icons_blu", +/* pickup */ "Sigil", 0, IT_SIGIL, PW_SIGILBLUE, @@ -932,10 +932,10 @@ Only in Domination games { "team_DOMINATION_sigil_green", NULL, - { "models/flags/g_flag.md3", + { "models/flags/g_sigil.md3", 0, 0, 0 }, -/* icon */ "icons/iconf_green1", -/* pickup */ "Flag", +/* icon */ "icons/icons_green", +/* pickup */ "Sigil", 0, IT_SIGIL, PW_SIGILGREEN, @@ -949,10 +949,10 @@ Only in Domination games { "team_DOMINATION_sigil_yellow", NULL, - { "models/flags/y_flag.md3", + { "models/flags/y_sigil.md3", 0, 0, 0 }, -/* icon */ "icons/iconf_yell1", -/* pickup */ "Flag", +/* icon */ "icons/icons_yellow", +/* pickup */ "Sigil", 0, IT_SIGIL, PW_SIGILYELLOW, @@ -966,10 +966,10 @@ Only in Domination games { "team_DOMINATION_sigil", NULL, - { "models/flags/n_flag.md3", + { "models/flags/n_sigil.md3", 0, 0, 0 }, -/* icon */ "icons/iconf_neutral1", -/* pickup */ "Flag", +/* icon */ "icons/icons_neutral", +/* pickup */ "Sigil", 0, IT_SIGIL, PW_SIGILWHITE, @@ -1530,12 +1530,18 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play // Q3Rally Code Start case IT_SIGIL: - // red team cannot touch a red sigil - if (ps->persistant[PERS_TEAM] == TEAM_RED && ent->powerups == PW_SIGILRED) - return qfalse; - // blue team cannot touch a blue sigil - else if (ps->persistant[PERS_TEAM] == TEAM_BLUE && ent->powerups == PW_SIGILBLUE) - return qfalse; + // red team cannot touch a red sigil + if (ps->persistant[PERS_TEAM] == TEAM_RED && ent->powerups == PW_SIGILRED) + return qfalse; + // blue team cannot touch a blue sigil + else if (ps->persistant[PERS_TEAM] == TEAM_BLUE && ent->powerups == PW_SIGILBLUE) + return qfalse; + // green team cannot touch a green sigil + else if (ps->persistant[PERS_TEAM] == TEAM_GREEN && ent->powerups == PW_SIGILGREEN) + return qfalse; + // yellow team cannot touch a yellow sigil + else if (ps->persistant[PERS_TEAM] == TEAM_YELLOW && ent->powerups == PW_SIGILYELLOW) + return qfalse; else return qtrue; // Q3Rally Code END diff --git a/engine/code/game/g_team.c b/engine/code/game/g_team.c index f2dc86fb..b57a47ee 100644 --- a/engine/code/game/g_team.c +++ b/engine/code/game/g_team.c @@ -80,6 +80,10 @@ void Team_InitGame( void ) { Team_SetSigilStatus( 1, SIGIL_ISWHITE ); teamgame.sigil[2].status = -1; // Invalid to force update Team_SetSigilStatus( 2, SIGIL_ISWHITE ); + teamgame.sigil[3].status = -1; // Invalid to force update + Team_SetSigilStatus( 3, SIGIL_ISWHITE ); + teamgame.sigil[4].status = -1; // Invalid to force update + Team_SetSigilStatus( 4, SIGIL_ISWHITE ); break; // Q3Rally Code END @@ -111,6 +115,12 @@ void Team_EndGame( void ) { if( teamgame.sigil[2].entity ) { teamgame.sigil[2].entity->nextthink = 0; } + if( teamgame.sigil[3].entity ) { + teamgame.sigil[3].entity->nextthink = 0; + } + if( teamgame.sigil[4].entity ) { + teamgame.sigil[4].entity->nextthink = 0; + } } } // Q3Rally Code END @@ -300,13 +310,15 @@ void Team_SetSigilStatus( int sigilNum, sigilStatus_t status ) { if( modified ) { - char st[4]; + char st[6]; - //send all 3 sigils' status to the configstring + //send all 5 sigils' status to the configstring st[0] = dominationSigilStatusRemap[teamgame.sigil[0].status]; st[1] = dominationSigilStatusRemap[teamgame.sigil[1].status]; st[2] = dominationSigilStatusRemap[teamgame.sigil[2].status]; - st[3] = 0; + st[3] = dominationSigilStatusRemap[teamgame.sigil[3].status]; + st[4] = dominationSigilStatusRemap[teamgame.sigil[4].status]; + st[5] = 0; trap_SetConfigstring( CS_SIGILSTATUS, st ); diff --git a/engine/code/qcommon/q_shared.h b/engine/code/qcommon/q_shared.h index c726d0b3..ddcccce6 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.3c_r415" +#define PRODUCT_VERSION "v0.3c_r420" #endif @@ -1794,7 +1794,7 @@ typedef enum _flag_status { // Q3Rally Code Start -#define MAX_SIGILS 3 +#define MAX_SIGILS 5 typedef enum _sigil_status { SIGIL_ISWHITE = 0, diff --git a/q3rallycode.ppr b/q3rallycode.ppr index fc846d36..3d6c20f2 100644 --- a/q3rallycode.ppr +++ b/q3rallycode.ppr @@ -122,7 +122,7 @@ q3rallycode engine\code\botlib\l_utils.h engine\code\botlib\lcc.mak engine\code\botlib\linux-i386.mak - -cgame + +cgame engine\code\cgame\cg_atmospheric.c engine\code\cgame\cg_consolecmds.c engine\code\cgame\cg_draw.c @@ -192,7 +192,7 @@ q3rallycode engine\code\client\snd_openal.c engine\code\client\snd_public.h engine\code\client\snd_wavelet.c - +game + -game engine\code\game\ai_chat.c engine\code\game\ai_chat.h engine\code\game\ai_cmd.c @@ -886,21 +886,21 @@ q3rallycode engine\cross-make-mingw64.sh [Open project files] 0=engine\code\qcommon\q_shared.h -1=engine\code\game\g_client.c -2=engine\code\game\g_missile.c -3=engine\code\game\g_weapon.c +1=engine\code\q3_ui\ui_playersettings.c +2=engine\code\cgame\cg_draw.c +3=engine\code\cgame\cg_local.h [Selected Project Files] Main= Selected=engine\code\qcommon\q_shared.h [engine\code\qcommon\q_shared.h] -TopLine=55 +TopLine=51 Caret=36,70 -[engine\code\game\g_client.c] -TopLine=1651 -Caret=9,1672 -[engine\code\game\g_missile.c] -TopLine=15 -Caret=27,34 -[engine\code\game\g_weapon.c] -TopLine=734 -Caret=27,742 +[engine\code\q3_ui\ui_playersettings.c] +TopLine=303 +Caret=1,311 +[engine\code\cgame\cg_draw.c] +TopLine=547 +Caret=2,570 +[engine\code\cgame\cg_local.h] +TopLine=1352 +Caret=1,1368