diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2010-12-06 09:56:08 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:44 +0000 |
commit | 1af0b33c17bfc7b3e42aa08cba1db6c17f12343b (patch) | |
tree | d0b28a11a3d0375716aa9c7fbdfe07f0b2521389 /src | |
parent | 5f6a45c447450b4da4ee8d519ae4ec7b6d1a41ee (diff) |
* (bug 4541) Improvement to font rendering speed by removing an unneeded function call (gimhael)
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/ui_shared.c | 9 |
1 files changed, 2 insertions, 7 deletions
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]; |