summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-12-21 09:42:55 -0500
committerOz Linden <oz@lindenlab.com>2011-12-21 09:42:55 -0500
commit889d4d292b2318a2be4988a700d5f56a193a377a (patch)
tree3e8be1a0c02e24c029b3baeb1abe3bce3e8bdcc9 /indra/llrender/llfontgl.cpp
parent457f150734c0f1b92f1c5c6cdb3a73fa0201183d (diff)
parentb022ebf13c9a227f87a112419e237894a1231c8c (diff)
merge up to latest viewer-development
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r--indra/llrender/llfontgl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 607473d416..82e8227ffe 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -304,6 +304,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
S32 next_bitmap_num = fgi->mBitmapNum;
if (next_bitmap_num != bitmap_num)
{
+ // Actually draw the queued glyphs before switching their texture;
+ // otherwise the queued glyphs will be taken from wrong textures.
+ if (glyph_count > 0)
+ {
+ gGL.begin(LLRender::QUADS);
+ {
+ gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4);
+ }
+ gGL.end();
+ glyph_count = 0;
+ }
+
bitmap_num = next_bitmap_num;
LLImageGL *font_image = font_bitmap_cache->getImageGL(bitmap_num);
gGL.getTexUnit(0)->bind(font_image);