From 1af0b33c17bfc7b3e42aa08cba1db6c17f12343b Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Mon, 6 Dec 2010 09:56:08 +0000 Subject: * (bug 4541) Improvement to font rendering speed by removing an unneeded function call (gimhael) --- src/ui/ui_shared.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 4f579e4a..1fbee153 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -1954,7 +1954,7 @@ static float UI_Parse_Indent( const char **text ) float UI_Text_Width( const char *text, float scale, int limit ) { - int count, len; + int count; float out; glyphInfo_t *glyph; float useScale; @@ -1978,15 +1978,10 @@ float UI_Text_Width( const char *text, float scale, int limit ) if( text ) { - len = Q_PrintStrlen( text ); - - if( limit > 0 && len > limit ) - len = limit; - count = 0; indentWidth = UI_Parse_Indent( &s ); - while( s && *s && count < len ) + while( s && *s && ( limit == 0 || count < limit ) ) { glyph = &font->glyphs[( int )*s]; -- cgit