diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 09:35:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 09:35:45 +0300 |
commit | 80a650dfb1e73363ae6924dc5738b732bb89ded4 (patch) | |
tree | 7d8af50bde3e4c32474d899a7fd00558afe9befc /source/blender/blenfont/intern/blf.c | |
parent | 59cfe81085b06243220cdb075a28a1352edebf7b (diff) |
BLF_draw functions take an extra length argument, so the console drawing doenst need to swap in NULL chars to draw word wrapping.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 59189abf1e3..70755ee1f82 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -361,7 +361,7 @@ void BLF_blur(int fontid, int size) font->blur= size; } -void BLF_draw_default(float x, float y, float z, const char *str) +void BLF_draw_default(float x, float y, float z, const char *str, size_t len) { if (!str) return; @@ -376,10 +376,10 @@ void BLF_draw_default(float x, float y, float z, const char *str) BLF_size(global_font_default, global_font_points, global_font_dpi); BLF_position(global_font_default, x, y, z); - BLF_draw(global_font_default, str); + BLF_draw(global_font_default, str, len); } /* same as above but call 'BLF_draw_ascii' */ -void BLF_draw_default_ascii(float x, float y, float z, const char *str) +void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t len) { if (!str) return; @@ -394,7 +394,7 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str) BLF_size(global_font_default, global_font_points, global_font_dpi); BLF_position(global_font_default, x, y, z); - BLF_draw_ascii(global_font_default, str); + BLF_draw_ascii(global_font_default, str, len); /* XXX, use real length */ } void BLF_rotation_default(float angle) @@ -432,22 +432,22 @@ static void blf_draw__end(void) glDisable(GL_TEXTURE_2D); } -void BLF_draw(int fontid, const char *str) +void BLF_draw(int fontid, const char *str, size_t len) { FontBLF *font= BLF_get(fontid); if (font) { blf_draw__start(font); - blf_font_draw(font, str); + blf_font_draw(font, str, len); blf_draw__end(); } } -void BLF_draw_ascii(int fontid, const char *str) +void BLF_draw_ascii(int fontid, const char *str, size_t len) { FontBLF *font= BLF_get(fontid); if (font) { blf_draw__start(font); - blf_font_draw_ascii(font, str); + blf_font_draw_ascii(font, str, len); blf_draw__end(); } } |