storm-1723: fix character display when a lot of different characters are used

master
Alissa Sabre 2011-12-15 15:19:50 -05:00
parent 363d41a34e
commit 6df5dfc0da
2 changed files with 13 additions and 0 deletions

View File

@ -159,6 +159,7 @@ Alissa Sabre
VWR-12620
VWR-12789
SNOW-322
STORM-1723
Alliez Mysterio
Angus Boyd
VWR-592

View File

@ -305,6 +305,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);