From 48ec61d2ea43fb7e57e6cb24813e60ed0286537e Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 23 Jul 2005 02:04:00 +0000 Subject: * Lagometer now disabled on demo playback * Lagometer rendering tweaked --- src/cgame/cg_draw.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 88068c65..f5fb5487 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2084,6 +2084,7 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, float v; float ax, ay, aw, ah, mid, range; int color; + vec4_t adjustedColor; float vscale; vec4_t white = { 1.0f, 1.0f, 1.0f, 1.0f }; @@ -2093,6 +2094,16 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, if( !cg_lagometer.integer ) return; + if( cg.demoPlayback ) + return; + + Vector4Copy( textColor, adjustedColor ); + adjustedColor[ 3 ] = 0.25f; + + trap_R_SetColor( adjustedColor ); + CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.whiteShader ); + trap_R_SetColor( NULL ); + // // draw the graph // @@ -2218,7 +2229,9 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, ax = rect->x + ( rect->w / 2.0f ) - ( CG_Text_Width( s, scale, 0 ) / 2.0f ) + text_x; ay = rect->y + ( rect->h / 2.0f ) + ( CG_Text_Height( s, scale, 0 ) / 2.0f ) + text_y; - CG_Text_Paint( ax, ay, scale, textColor, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); + Vector4Copy( textColor, adjustedColor ); + adjustedColor[ 3 ] = 0.5f; + CG_Text_Paint( ax, ay, scale, adjustedColor, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); } CG_DrawDisconnect( ); -- cgit