From: divverent Date: Thu, 24 Dec 2009 11:51:31 +0000 (+0000) Subject: same fix in DrawQ_String X-Git-Tag: xonotic-v0.1.0preview~981 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=1c0e2f0c8c957d626ee2c7ac22be4b0103d59226;p=xonotic%2Fdarkplaces.git same fix in DrawQ_String git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9667 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_draw.c b/gl_draw.c index 0bd87d9b..efde7524 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -1331,7 +1331,7 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max for (i = 0;((bytes_left = maxlen - (text - text_start)) > 0) && *text;) { nextch = ch = u8_getnchar(text, &text, bytes_left); - //i = text - text_start; + i = text - text_start; if (!ch) break; if (snap) @@ -1342,12 +1342,10 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max if (ch == ' ' && !fontmap) { x += fnt->width_of[(int) ' '] * w; - ++i; continue; } - if (ch == STRING_COLOR_TAG && !ignorecolorcodes && i + 1 < maxlen) + if (ch == STRING_COLOR_TAG && !ignorecolorcodes && i < maxlen) { - ++i; ch = *text; // colors are ascii, so no u8_ needed if (ch <= '9' && ch >= '0') // ^[0-9] found { @@ -1399,7 +1397,6 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max } // get the backup ch = nextch; - ++i; // using a value of -1 for the oldstyle map because NULL means uninitialized... // this way we don't need to rebind fnt->tex for every old-style character // E000..E0FF: emulate old-font characters (to still have smileys and such available)