From a10468a5e6140ed9658c3fd564b0f4a40ae1f111 Mon Sep 17 00:00:00 2001 From: blub Date: Sun, 3 Jan 2010 11:46:38 +0000 Subject: [PATCH] width_of_factor is now useless since it's always equal to dw - replaced it git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9772 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_draw.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/gl_draw.c b/gl_draw.c index 5bf47364..a18e59cd 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -1103,7 +1103,6 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max qboolean snap = true; qboolean least_one = false; float dw, dh; // display w/h - float width_of_factor; const float *width_of; if (!h) h = w; @@ -1149,15 +1148,9 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max // x = snap_to_pixel_x(x, 0.4); // haha, it's 0 anyway if (fontmap) - { - width_of_factor = dw; width_of = fontmap->width_of; - } else - { - width_of_factor = dw; width_of = fnt->width_of; - } for (i = 0;((bytes_left = *maxlen - (text - text_start)) > 0) && *text;) { @@ -1169,12 +1162,12 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max if (ch == ' ' && !fontmap) { if(!least_one || i0) // never skip the first character - if(x + width_of[(int) ' '] * width_of_factor > maxwidth) + if(x + width_of[(int) ' '] * dw > maxwidth) { i = i0; break; // oops, can't draw this } - x += width_of[(int) ' '] * width_of_factor; + x += width_of[(int) ' '] * dw; continue; } // i points to the char after ^ @@ -1241,12 +1234,12 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max map = ft2_oldstyle_map; prevch = 0; if(!least_one || i0) // never skip the first character - if(x + width_of[ch] * width_of_factor > maxwidth) + if(x + width_of[ch] * dw > maxwidth) { i = i0; break; // oops, can't draw this } - x += width_of[ch] * width_of_factor; + x += width_of[ch] * dw; } else { if (!map || map == ft2_oldstyle_map || map->start < ch || map->start + FONT_CHARS_PER_MAP >= ch) { @@ -1302,7 +1295,6 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma float pix_x, pix_y; size_t bytes_left; float dw, dh; - float width_of_factor; const float *width_of; int tw, th; @@ -1365,15 +1357,9 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma pix_y = vid.height / vid_conheight.value; if (fontmap) - { - width_of_factor = dw; width_of = fontmap->width_of; - } else - { - width_of_factor = dw; width_of = fnt->width_of; - } for (shadow = r_textshadow.value != 0 && basealpha > 0;shadow >= 0;shadow--) { @@ -1404,7 +1390,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma break; if (ch == ' ' && !fontmap) { - x += width_of[(int) ' '] * width_of_factor; + x += width_of[(int) ' '] * dw; continue; } if (ch == STRING_COLOR_TAG && !ignorecolorcodes && i < maxlen) @@ -1528,7 +1514,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma at = texcoord2f; av = vertex3f; } - x += width_of[ch] * width_of_factor; + x += width_of[ch] * dw; } else { if (!map || map == ft2_oldstyle_map || map->start < ch || map->start + FONT_CHARS_PER_MAP >= ch) { -- 2.39.2