Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-12 13:12:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-12 13:12:34 +0400
commit156e96762b64eae7bc10d1ef58130107777ddb11 (patch)
tree6dddc1e70408967a2c5e43489e82155eb781e426 /source/blender/blenfont/intern/blf_glyph.c
parentd9894af95085fb9f1d3baafc3a76fc6ba6081cfd (diff)
fix for changing font sizes with recent utf8 speedup
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index e165012f43e..9b39cb65cba 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -74,7 +74,6 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi)
GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
{
GlyphCacheBLF *gc;
- int i;
gc= (GlyphCacheBLF *)MEM_mallocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
gc->next= NULL;
@@ -82,10 +81,8 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
gc->size= font->size;
gc->dpi= font->dpi;
- for (i= 0; i < 257; i++) {
- gc->bucket[i].first= NULL;
- gc->bucket[i].last= NULL;
- }
+ memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table));
+ memset(gc->bucket, 0, sizeof(gc->bucket));
gc->textures= (GLuint *)malloc(sizeof(GLuint)*256);
gc->ntex= 256;
@@ -136,7 +133,9 @@ void blf_glyph_cache_clear(FontBLF *font)
}
}
- memset(font->glyph_ascii_table, 0, sizeof(font->glyph_ascii_table));
+ if(font->glyph_cache) {
+ memset(font->glyph_cache->glyph_ascii_table, 0, sizeof(font->glyph_cache->glyph_ascii_table));
+ }
}
void blf_glyph_cache_free(GlyphCacheBLF *gc)