]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
same fix in DrawQ_String
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 24 Dec 2009 11:51:31 +0000 (11:51 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 24 Dec 2009 11:51:31 +0000 (11:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9667 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index 0bd87d9b18f4ea9288883ae36d87a94d64ddcc0b..efde7524d59544e7a2aecffbbc582da55b9ae151 100644 (file)
--- 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)