diff options
author | Ben Millwood <thebenmachine@gmail.com> | 2009-10-03 12:34:09 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:04 +0000 |
commit | f2ae86b04049a856e1346e09301335e085219327 (patch) | |
tree | d111c0bb047858109ae430869a356c71919ef592 /src/cgame/cg_draw.c | |
parent | 106b80cb16f76af0f6dc51bbd922c740e7ddb16a (diff) |
* Fix incorrect positioning of some text display in lagometer
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r-- | src/cgame/cg_draw.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 779b8dff..9469410f 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -1906,6 +1906,7 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, vec4_t adjustedColor; float vscale; vec4_t white = { 1.0f, 1.0f, 1.0f, 1.0f }; + char *ping; if( cg.snap->ps.pm_type == PM_INTERMISSION ) return; @@ -2028,19 +2029,18 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, trap_R_SetColor( NULL ); if( cg_nopredict.integer || cg_synchronousClients.integer ) - UI_Text_Paint( ax, ay, 0.5, white, "snc", 0, 0, ITEM_TEXTSTYLE_NORMAL ); + ping = "snc"; else - { - char *s; - - s = va( "%d", cg.ping ); - ax = rect->x + ( rect->w / 2.0f ) - ( UI_Text_Width( s, scale, 0 ) / 2.0f ) + text_x; - ay = rect->y + ( rect->h / 2.0f ) + ( UI_Text_Height( s, scale, 0 ) / 2.0f ) + text_y; + ping = va( "%d", cg.ping ); + ax = rect->x + ( rect->w / 2.0f ) - + ( UI_Text_Width( ping, scale, 0 ) / 2.0f ) + text_x; + ay = rect->y + ( rect->h / 2.0f ) + + ( UI_Text_Height( ping, scale, 0 ) / 2.0f ) + text_y; - Vector4Copy( textColor, adjustedColor ); - adjustedColor[ 3 ] = 0.5f; - UI_Text_Paint( ax, ay, scale, adjustedColor, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); - } + Vector4Copy( textColor, adjustedColor ); + adjustedColor[ 3 ] = 0.5f; + UI_Text_Paint( ax, ay, scale, adjustedColor, ping, 0, 0, + ITEM_TEXTSTYLE_NORMAL ); CG_DrawDisconnect( ); } |