diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-23 06:37:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-23 06:37:09 +0400 |
commit | c02c2dfdd911fd1c92236e810f26da13f79cf8a5 (patch) | |
tree | af716be61a5bc11b9bf2883ced73418d4279604e /source/blender/gpu | |
parent | 2f46ed5564ffb3d0550b09ee905bd37decb4a4b6 (diff) |
BGE Bitmap Text: add in check if the character is outside the range
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 74112583a3f..c4827a5868c 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -97,7 +97,7 @@ void GPU_render_text(MTFace *tface, int mode, Image* ima = (Image *)tface->tpage; ImBuf *first_ibuf; const size_t textlen_st = textlen; - size_t index, character; + size_t index; float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance; float advance_tab; @@ -129,6 +129,7 @@ void GPU_render_text(MTFace *tface, int mode, for (index = 0; index < textlen_st; ) { + unsigned int character; float uv[4][2]; // lets calculate offset stuff @@ -145,6 +146,10 @@ void GPU_render_text(MTFace *tface, int mode, continue; } + else if (character > USHRT_MAX) { + /* not much we can do here bmfonts take ushort */ + character = '?'; + } // space starts at offset 1 // character = character - ' ' + 1; |