Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings
This commit is contained in:
parent
1ea7ab1f42
commit
23f6fd1633
85 changed files with 246 additions and 496 deletions
|
@ -904,9 +904,9 @@ static float CG_DrawTeamOverlay( float y, qboolean right, qboolean upper ) {
|
|||
p = CG_ConfigString(CS_LOCATIONS + ci->location);
|
||||
if (!p || !*p)
|
||||
p = "unknown";
|
||||
len = CG_DrawStrlen(p);
|
||||
if (len > lwidth)
|
||||
len = lwidth;
|
||||
// len = CG_DrawStrlen(p);
|
||||
// if (len > lwidth)
|
||||
// len = lwidth;
|
||||
|
||||
// xx = x + TINYCHAR_WIDTH * 2 + TINYCHAR_WIDTH * pwidth +
|
||||
// ((lwidth/2 - len/2) * TINYCHAR_WIDTH);
|
||||
|
@ -1348,8 +1348,8 @@ CG_DrawTeamInfo
|
|||
*/
|
||||
#ifndef MISSIONPACK
|
||||
static void CG_DrawTeamInfo( void ) {
|
||||
int w, h;
|
||||
int i, len;
|
||||
int h;
|
||||
int i;
|
||||
vec4_t hcolor;
|
||||
int chatHeight;
|
||||
|
||||
|
@ -1370,16 +1370,6 @@ static void CG_DrawTeamInfo( void ) {
|
|||
|
||||
h = (cgs.teamChatPos - cgs.teamLastChatPos) * TINYCHAR_HEIGHT;
|
||||
|
||||
w = 0;
|
||||
|
||||
for (i = cgs.teamLastChatPos; i < cgs.teamChatPos; i++) {
|
||||
len = CG_DrawStrlen(cgs.teamChatMsgs[i % chatHeight]);
|
||||
if (len > w)
|
||||
w = len;
|
||||
}
|
||||
w *= TINYCHAR_WIDTH;
|
||||
w += TINYCHAR_WIDTH * 2;
|
||||
|
||||
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) {
|
||||
hcolor[0] = 1.0f;
|
||||
hcolor[1] = 0.0f;
|
||||
|
@ -1924,7 +1914,7 @@ CG_DrawCrosshair3D
|
|||
*/
|
||||
static void CG_DrawCrosshair3D(void)
|
||||
{
|
||||
float w, h;
|
||||
float w;
|
||||
qhandle_t hShader;
|
||||
float f;
|
||||
int ca;
|
||||
|
@ -1947,14 +1937,13 @@ static void CG_DrawCrosshair3D(void)
|
|||
return;
|
||||
}
|
||||
|
||||
w = h = cg_crosshairSize.value;
|
||||
w = cg_crosshairSize.value;
|
||||
|
||||
// pulse the size of the crosshair when picking up items
|
||||
f = cg.time - cg.itemPickupBlendTime;
|
||||
if ( f > 0 && f < ITEM_BLOB_TIME ) {
|
||||
f /= ITEM_BLOB_TIME;
|
||||
w *= ( 1 + f );
|
||||
h *= ( 1 + f );
|
||||
}
|
||||
|
||||
ca = cg_drawCrosshair.integer;
|
||||
|
@ -2164,7 +2153,6 @@ static void CG_DrawTeamVote(void) {
|
|||
static qboolean CG_DrawScoreboard( void ) {
|
||||
#ifdef MISSIONPACK
|
||||
static qboolean firstTime = qtrue;
|
||||
float fade, *fadeColor;
|
||||
|
||||
if (menuScoreboard) {
|
||||
menuScoreboard->window.flags &= ~WINDOW_FORCED;
|
||||
|
@ -2188,20 +2176,15 @@ static qboolean CG_DrawScoreboard( void ) {
|
|||
}
|
||||
|
||||
if ( cg.showScores || cg.predictedPlayerState.pm_type == PM_DEAD || cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
|
||||
fade = 1.0;
|
||||
fadeColor = colorWhite;
|
||||
} else {
|
||||
fadeColor = CG_FadeColor( cg.scoreFadeTime, FADE_TIME );
|
||||
if ( !fadeColor ) {
|
||||
if ( !CG_FadeColor( cg.scoreFadeTime, FADE_TIME ) ) {
|
||||
// next time scoreboard comes up, don't print killer
|
||||
cg.deferredPlayerLoading = 0;
|
||||
cg.killerName[0] = 0;
|
||||
firstTime = qtrue;
|
||||
return qfalse;
|
||||
}
|
||||
fade = *fadeColor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (menuScoreboard == NULL) {
|
||||
if ( cgs.gametype >= GT_TEAM ) {
|
||||
|
@ -2361,9 +2344,12 @@ static void CG_DrawWarmup( void ) {
|
|||
int w;
|
||||
int sec;
|
||||
int i;
|
||||
float scale;
|
||||
clientInfo_t *ci1, *ci2;
|
||||
#ifdef MISSIONPACK
|
||||
float scale;
|
||||
#else
|
||||
int cw;
|
||||
#endif
|
||||
clientInfo_t *ci1, *ci2;
|
||||
const char *s;
|
||||
|
||||
sec = cg.warmup;
|
||||
|
@ -2464,30 +2450,41 @@ static void CG_DrawWarmup( void ) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
scale = 0.45f;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
switch ( cg.warmupCount ) {
|
||||
case 0:
|
||||
cw = 28;
|
||||
scale = 0.54f;
|
||||
break;
|
||||
case 1:
|
||||
cw = 24;
|
||||
scale = 0.51f;
|
||||
break;
|
||||
case 2:
|
||||
cw = 20;
|
||||
scale = 0.48f;
|
||||
break;
|
||||
default:
|
||||
cw = 16;
|
||||
scale = 0.45f;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
w = CG_Text_Width(s, scale, 0);
|
||||
CG_Text_Paint(320 - w / 2, 125, scale, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
|
||||
w = CG_Text_Width(s, scale, 0);
|
||||
CG_Text_Paint(320 - w / 2, 125, scale, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
|
||||
#else
|
||||
switch ( cg.warmupCount ) {
|
||||
case 0:
|
||||
cw = 28;
|
||||
break;
|
||||
case 1:
|
||||
cw = 24;
|
||||
break;
|
||||
case 2:
|
||||
cw = 20;
|
||||
break;
|
||||
default:
|
||||
cw = 16;
|
||||
break;
|
||||
}
|
||||
|
||||
w = CG_DrawStrlen( s );
|
||||
CG_DrawStringExt( 320 - w * cw/2, 70, s, colorWhite,
|
||||
qfalse, qtrue, cw, (int)(cw * 1.5), 0 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue