--- deliantra/Deliantra-Client/pango-render.c 2006/07/04 23:44:23 1.2 +++ deliantra/Deliantra-Client/pango-render.c 2006/07/04 23:56:34 1.3 @@ -148,6 +148,7 @@ typedef struct glyph_info { tc_area tex; int left, top; + int generation; } glyph_info; static void @@ -174,12 +175,20 @@ g = _pango_opengl_font_get_cache_glyph_data (font, glyph); - if (!g) + if (!g || g->generation != tc_generation) { Glyph bm; font_render_glyph (&bm, font, glyph); - g = g_slice_new (glyph_info); + if (g) + g->generation = tc_generation; + else + { + g = g_slice_new (glyph_info); + + _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info); + _pango_opengl_font_set_cache_glyph_data (font, glyph, g); + } tc_get (&g->tex, bm.width, bm.height); @@ -198,9 +207,6 @@ glTexSubImage2D (GL_TEXTURE_2D, 0, g->tex.x, g->tex.y, bm.width, bm.height, GL_ALPHA, GL_UNSIGNED_BYTE, bm.bitmap); glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); glPixelStorei (GL_UNPACK_ALIGNMENT, 4); - - _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info); - _pango_opengl_font_set_cache_glyph_data (font, glyph, g); } x += g->left;