Skip to content

Commit

Permalink
Reverted all 4TCTF Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
perle committed Jul 31, 2024
1 parent 84dc097 commit 844b2d5
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 334 deletions.
161 changes: 58 additions & 103 deletions engine/code/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo
handle = cgs.media.redFlagModel;
} else if( team == TEAM_BLUE ) {
handle = cgs.media.blueFlagModel;
} else if( team == TEAM_GREEN) {
handle = cgs.media.greenFlagModel;
} else if( team == TEAM_YELLOW ) {
handle = cgs.media.yellowFlagModel;
} else if( team == TEAM_FREE ) {
handle = cgs.media.neutralFlagModel;
} else {
Expand All @@ -408,10 +404,6 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo
item = BG_FindItemForPowerup( PW_REDFLAG );
} else if( team == TEAM_BLUE ) {
item = BG_FindItemForPowerup( PW_BLUEFLAG );
} else if( team == TEAM_GREEN ) {
item = BG_FindItemForPowerup( PW_GREENFLAG );
} else if( team == TEAM_YELLOW ) {
item = BG_FindItemForPowerup( PW_YELLOWFLAG );
} else if( team == TEAM_FREE ) {
item = BG_FindItemForPowerup( PW_NEUTRALFLAG );
} else {
Expand Down Expand Up @@ -648,10 +640,6 @@ static void CG_DrawStatusBar( void ) {
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_RED );
} else if( cg.predictedPlayerState.powerups[PW_BLUEFLAG] ) {
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_BLUE );
} else if( cg.predictedPlayerState.powerups[PW_GREENFLAG] ) {
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_GREEN );
} else if( cg.predictedPlayerState.powerups[PW_YELLOWFLAG] ) {
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_YELLOW );
} else if( cg.predictedPlayerState.powerups[PW_NEUTRALFLAG] ) {
CG_DrawStatusBarFlag( 185 + CHAR_WIDTH*3 + TEXT_ICON_SPACE + ICON_SIZE, TEAM_FREE );
}
Expand Down Expand Up @@ -859,10 +847,6 @@ static void CG_DrawRallyStatusBar( void ) {
CG_DrawStatusBarFlag( 495, TEAM_RED);
else if (cg.predictedPlayerState.powerups[PW_BLUEFLAG])
CG_DrawStatusBarFlag( 495, TEAM_BLUE);
else if (cg.predictedPlayerState.powerups[PW_GREENFLAG])
CG_DrawStatusBarFlag( 495, TEAM_GREEN);
else if (cg.predictedPlayerState.powerups[PW_YELLOWFLAG])
CG_DrawStatusBarFlag( 495, TEAM_YELLOW);
else if (cg_entities[cg.snap->ps.clientNum].finishRaceTime &&
cg_entities[cg.snap->ps.clientNum].currentPosition == 1){

Expand Down Expand Up @@ -1195,17 +1179,17 @@ static void CG_DrawRallyPowerups( void ) {
active++;
}

// draw the icons and timers TRYOUT: bug #71
// draw the icons and timers

for ( i = 0 ; i < active ; i++ ) {
item = BG_FindItemForPowerup( sorted[i] );

color = 1;

CG_FillRect( 495, 476 - 30, 90, 24, bg_color );
CG_FillRect( 402, 476 - 30, 90, 24, bg_color );

trap_R_SetColor( colors[color] );
CG_DrawField( 517 + CHAR_WIDTH, 476 - 28, 2, sortedTime[ i ] / 1000 );
CG_DrawField( 424 + CHAR_WIDTH, 476 - 28, 2, sortedTime[ i ] / 1000 );

t = ps->powerups[ sorted[i] ];
if ( t - cg.time >= POWERUP_BLINKS * POWERUP_BLINK_TIME ) {
Expand All @@ -1232,7 +1216,7 @@ static void CG_DrawRallyPowerups( void ) {
size = 19;
}

CG_DrawPic( 503, 476 - 27, size, size, trap_R_RegisterShader( item->icon ) );
CG_DrawPic( 408, 476 - 27, size, size, trap_R_RegisterShader( item->icon ) );
}
trap_R_SetColor( NULL );
}
Expand Down Expand Up @@ -1359,7 +1343,7 @@ static float CG_DrawFPS( float y ) {
s = va( "%ifps", fps );
w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH;

CG_DrawBigString( 622 - w, 355 + 2, s, 1.0F);
CG_DrawBigString( 635 - w, y + 2, s, 1.0F);
}

return y + BIGCHAR_HEIGHT + 4;
Expand Down Expand Up @@ -1641,9 +1625,9 @@ float CG_DrawScores( float x, float y ) {
if ( cgs.gametype >= GT_TEAM ) {

CG_FillRect( x - 80, y, 96, 18, bgColor );
// draw yellow

if (cgs.gametype >= GT_TEAM){
// draw yellow
color[0] = 1.0f;
color[1] = 1.0f;
color[2] = 0.0f;
Expand All @@ -1657,23 +1641,7 @@ 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;
Expand All @@ -1686,84 +1654,71 @@ 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);
}

if ( cgs.gametype == GT_CTF ) {
// Display green flag status
item = BG_FindItemForPowerup( PW_GREENFLAG );
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 );

if (item) {
}

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);
CG_DrawTinyDigitalString( x + 4, y+4, s, 1.0F);

if ( cgs.gametype == GT_CTF ) {
// Display blue flag status
item = BG_FindItemForPowerup( PW_BLUEFLAG );
if ( cgs.gametype == GT_CTF ) {
// Display flag status
item = BG_FindItemForPowerup( PW_BLUEFLAG );

if (item) {

y1 = y + TINYCHAR_HEIGHT + 8;
if( cgs.blueflag >= 0 && cgs.blueflag <= 2 ) {
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;
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 red flag status
item = BG_FindItemForPowerup( PW_REDFLAG );
}
}
}

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);

if ( cgs.gametype == GT_CTF ) {
// Display flag status
item = BG_FindItemForPowerup( PW_REDFLAG );

if (item) {

y1 = y + TINYCHAR_HEIGHT + 8;
if( cgs.redflag >= 0 && cgs.redflag <= 2 ) {
y1 = y + TINYCHAR_HEIGHT + 8;

CG_DrawPic( x+1, y1+1, w-2, 16, cgs.media.redFlagShader[cgs.redflag] );

}
}
}
if( cgs.redflag >= 0 && cgs.redflag <= 2 ) {


}
}
}



#ifdef MISSIONPACK
if ( cgs.gametype == GT_1FCTF ) {
// Display flag status
Expand Down
4 changes: 1 addition & 3 deletions engine/code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,6 @@ typedef struct {

qhandle_t redFlagFlapSkin;
qhandle_t blueFlagFlapSkin;
qhandle_t greenFlagFlapSkin;
qhandle_t yellowFlagFlapSkin;
qhandle_t neutralFlagFlapSkin;

qhandle_t redFlagBaseModel;
Expand Down Expand Up @@ -1244,7 +1242,7 @@ typedef struct {
// Q3Rally Code Start
int scores3, scores4; // from configstrings
// Q3Rally Code END
int redflag, blueflag, greenflag, yellowflag; // flag status from configstrings
int redflag, blueflag; // flag status from configstrings
int flagStatus;
int sigil[MAX_SIGILS];
qboolean newHud;
Expand Down
12 changes: 1 addition & 11 deletions engine/code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,6 @@ static void CG_RegisterGraphics( void ) {

cgs.media.redFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/red.skin" );
cgs.media.blueFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/blue.skin" );
cgs.media.greenFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/green.skin" );
cgs.media.yellowFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/yellow.skin" );
cgs.media.neutralFlagFlapSkin = trap_R_RegisterSkin( "models/flag2/white.skin" );

cgs.media.redFlagBaseModel = trap_R_RegisterModel( "models/mapobjects/flagbase/red_base.md3" );
Expand Down Expand Up @@ -1912,10 +1910,6 @@ static const char *CG_FeederItemText(float feederID, int index, int column, qhan
team = TEAM_RED;
} else if (feederID == FEEDER_BLUETEAM_LIST) {
team = TEAM_BLUE;
} else if (feederID == FEEDER_GREENTEAM_LIST) {
team = TEAM_GREEN;
} else if (feederID == FEEDER_YELLOWTEAM_LIST) {
team = TEAM_YELLOW;
}

info = CG_InfoFromScoreIndex(index, team, &scoreIndex);
Expand All @@ -1932,10 +1926,6 @@ static const char *CG_FeederItemText(float feederID, int index, int column, qhan
*handle = cg_items[ ITEM_INDEX(item) ].icon;
} else if ( info->powerups & ( 1 << PW_BLUEFLAG ) ) {
item = BG_FindItemForPowerup( PW_BLUEFLAG );
} else if ( info->powerups & ( 1 << PW_GREENFLAG ) ) {
item = BG_FindItemForPowerup( PW_GREENFLAG );
} else if ( info->powerups & ( 1 << PW_YELLOWFLAG ) ) {
item = BG_FindItemForPowerup( PW_YELLOWFLAG );
*handle = cg_items[ ITEM_INDEX(item) ].icon;
} else {
if ( info->botSkill > 0 && info->botSkill <= 5 ) {
Expand Down Expand Up @@ -2203,7 +2193,7 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) {

cg.weaponSelect = WP_MACHINEGUN;

cgs.redflag = cgs.blueflag = cgs.greenflag = cgs.yellowflag = -1; // For compatibily, default to unset for
cgs.redflag = cgs.blueflag = -1; // For compatibily, default to unset for
cgs.flagStatus = -1;
// Q3Rally Code Start
for ( i = 0; i < MAX_SIGILS; i++ ) {
Expand Down
3 changes: 3 additions & 0 deletions engine/code/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,7 @@ static void CG_PlayerPowerups( centity_t *cent, refEntity_t *torso ) {
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 0.2f, 0.2f, 1.0 );
}

/* finish in 0.5
// greenflag
if ( powerups & ( 1 << PW_GREENFLAG ) ) {
Expand All @@ -2439,6 +2440,8 @@ static void CG_PlayerPowerups( centity_t *cent, refEntity_t *torso ) {
trap_R_AddLightToScene( cent->lerpOrigin, 200 + (rand()&31), 1.0, 1.0, 0.2f );
}
// end finish in 0.5
*/

// neutralflag
if ( powerups & ( 1 << PW_NEUTRALFLAG ) ) {
Expand Down
2 changes: 0 additions & 2 deletions engine/code/cgame/cg_playerstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
if ( cgs.gametype > GT_TEAM ) {
if ((ps->powerups[PW_REDFLAG] != ops->powerups[PW_REDFLAG] && ps->powerups[PW_REDFLAG]) ||
(ps->powerups[PW_BLUEFLAG] != ops->powerups[PW_BLUEFLAG] && ps->powerups[PW_BLUEFLAG]) ||
(ps->powerups[PW_GREENFLAG] != ops->powerups[PW_GREENFLAG] && ps->powerups[PW_GREENFLAG]) ||
(ps->powerups[PW_YELLOWFLAG] != ops->powerups[PW_YELLOWFLAG] && ps->powerups[PW_YELLOWFLAG]) ||
(ps->powerups[PW_NEUTRALFLAG] != ops->powerups[PW_NEUTRALFLAG] && ps->powerups[PW_NEUTRALFLAG]) )
{
trap_S_StartLocalSound( cgs.media.youHaveFlagSound, CHAN_ANNOUNCER );
Expand Down
6 changes: 0 additions & 6 deletions engine/code/cgame/cg_predict.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,6 @@ static void CG_TouchItem( centity_t *cent ) {
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_BLUE &&
item->giType == IT_TEAM && item->giTag == PW_BLUEFLAG)
return;
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_GREEN &&
item->giType == IT_TEAM && item->giTag == PW_GREENFLAG)
return;
if (cg.predictedPlayerState.persistant[PERS_TEAM] == TEAM_YELLOW &&
item->giType == IT_TEAM && item->giTag == PW_YELLOWFLAG)
return;
}

// grab it
Expand Down
14 changes: 0 additions & 14 deletions engine/code/cgame/cg_scoreboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ static void CG_DrawClientScore( int y, score_t *score, float *color, float fade,
else {
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_BLUE, qfalse );
}
} else if ( ci->powerups & ( 1 << PW_GREENFLAG ) ) {
if( largeFormat ) {
CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_GREEN, qfalse );
}
else {
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_GREEN, qfalse );
}
} else if ( ci->powerups & ( 1 << PW_YELLOWFLAG ) ) {
if( largeFormat ) {
CG_DrawFlagModel( iconx, y - ( 32 - BIGCHAR_HEIGHT ) / 2, 32, 32, TEAM_YELLOW, qfalse );
}
else {
CG_DrawFlagModel( iconx, y, 16, 16, TEAM_YELLOW, qfalse );
}
}
// STONELANCE - draw flag beside winner
else if (cg_entities[score->client].finishRaceTime &&
Expand Down
Loading

0 comments on commit 844b2d5

Please sign in to comment.