cg_RQ3_drawSpeed cvar to print player movement speed in units per second

This commit is contained in:
Scott Brooks 2009-07-11 03:06:29 +00:00
parent c34e4c0e65
commit 025210812d
3 changed files with 35 additions and 0 deletions

View file

@ -755,6 +755,33 @@ static float CG_DrawAttacker(float y)
return y + BIGCHAR_HEIGHT + 2;
}
static float CG_DrawSpeed(float y)
{
char *s;
int w;
int x = 0;
float Color[4];
vec3_t vel;
VectorCopy( cg.snap->ps.velocity, vel );
vel[2] = 0.0f;
y += 4;
s = va("%3.0f UPS", VectorLength(vel) );
w = CG_DrawStrlen(s) * SMALLCHAR_WIDTH;
x = w;
MAKERGBA(Color, 0.0f, 0.0f, 0.0f, 0.4f);
CG_FillRect(631 - x - 3, y - 1, w + 6, SMALLCHAR_HEIGHT + 6, Color);
MAKERGBA(Color, 0.0f, 0.0f, 0.0f, 1.0f);
CG_DrawCleanRect(631 - x - 3, y - 1, w + 6, SMALLCHAR_HEIGHT + 6, 1, Color);
CG_DrawSmallString(631 - x, y + 2, s, 1.0F);
return y + SMALLCHAR_HEIGHT + 4;
}
/*
==================
CG_DrawSnapshot
@ -1203,6 +1230,9 @@ static void CG_DrawUpperRight(void)
if (cg_drawAttacker.integer)
y = CG_DrawAttacker(y);
if (cg_RQ3_drawSpeed.integer)
y = CG_DrawSpeed(y);
}
/*

View file

@ -1881,6 +1881,7 @@ extern vmCvar_t cg_RQ3_ammo_m3;
extern vmCvar_t cg_RQ3_ammo_ssg3000;
extern vmCvar_t cg_RQ3_ammo_mp5;
extern vmCvar_t cg_RQ3_ammo_m4;
extern vmCvar_t cg_RQ3_drawSpeed;
extern vmCvar_t cg_RQ3_zcam_stfu;

View file

@ -557,6 +557,8 @@ vmCvar_t cg_RQ3_ammo_ssg3000;
vmCvar_t cg_RQ3_ammo_mp5;
vmCvar_t cg_RQ3_ammo_m4;
vmCvar_t cg_RQ3_drawSpeed;
vmCvar_t cg_RQ3_zcam_stfu;
//Elder: muzzle flash toggle
@ -836,6 +838,8 @@ static cvarTable_t cvarTable[] = { // bk001129
{&cg_RQ3_ammo_mp5, "cg_RQ3_ammo_mp5", "mp5/default", CVAR_ARCHIVE},
{&cg_RQ3_ammo_m4, "cg_RQ3_ammo_m4", "m4/default", CVAR_ARCHIVE},
{&cg_RQ3_drawSpeed, "cg_RQ3_drawSpeed", "0", CVAR_ARCHIVE},
{&cg_RQ3_zcam_stfu, "cg_RQ3_zcam_stfu", "0", CVAR_USERINFO | CVAR_ARCHIVE},
// the following variables are created in other parts of the system,