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-18 14:34:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-18 14:34:13 +0400
commit53845a37d9d33703e18236212ee3ef52982a6247 (patch)
tree06f89615df2b2411bee99032e711210cfdc9bdef /source/blender/blenfont/intern/blf_glyph.c
parent249b41762a98b5e357cc32e0ba0cb673fc0c6225 (diff)
blf - further shrink drawing functions & some style changes.
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 7a1fa8c80b0..b661005b50b 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -64,10 +64,10 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi)
p= (GlyphCacheBLF *)font->cache.first;
while (p) {
if (p->size == size && p->dpi == dpi)
- return(p);
+ return p;
p= p->next;
}
- return(NULL);
+ return NULL;
}
/* Create a new glyph cache for the current size and dpi. */
@@ -114,7 +114,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
gc->p2_height= 0;
BLI_addhead(&font->cache, gc);
- return(gc);
+ return gc;
}
void blf_glyph_cache_clear(FontBLF *font)
@@ -204,10 +204,10 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
p= gc->bucket[key].first;
while (p) {
if (p->c == c)
- return(p);
+ return p;
p= p->next;
}
- return(NULL);
+ return NULL;
}
GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
@@ -222,14 +222,14 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
g= blf_glyph_search(font->glyph_cache, c);
if (g)
- return(g);
+ return g;
if (sharp)
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
else
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
if (err)
- return(NULL);
+ return NULL;
/* get the glyph. */
slot= font->face->glyph;
@@ -248,7 +248,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
}
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
- return(NULL);
+ return NULL;
g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add");
g->next= NULL;
@@ -294,7 +294,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
key= blf_hash(g->c);
BLI_addhead(&(font->glyph_cache->bucket[key]), g);
- return(g);
+ return g;
}
void blf_glyph_free(GlyphBLF *g)
@@ -383,7 +383,7 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
float xo, yo;
if ((!g->width) || (!g->height))
- return(1);
+ return 1;
if (g->build_tex == 0) {
GlyphCacheBLF *gc= font->glyph_cache;
@@ -449,13 +449,13 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
if (font->flags & BLF_CLIPPING) {
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1]))
- return(0);
+ return 0;
}
if (font->tex_bind_state != g->tex) {
@@ -500,5 +500,5 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
break;
}
- return(1);
+ return 1;
}