diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-10-24 15:16:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-10-24 15:16:48 +0400 |
commit | 14bbff61fecf95c0cc9dc20a480985d599159470 (patch) | |
tree | 6489a26e639c1af1376296ed01390a07e3459012 /intern/bmfont | |
parent | 2339eacce874d2dd922c5163d7a3898b6d2f325f (diff) |
set the alpha value of text, so stamps are always visible in RGBA
images, (reported by basse)
Diffstat (limited to 'intern/bmfont')
-rw-r--r-- | intern/bmfont/intern/BMF_BitmapFont.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/intern/bmfont/intern/BMF_BitmapFont.cpp b/intern/bmfont/intern/BMF_BitmapFont.cpp index 99ded41007f..c47b2b07195 100644 --- a/intern/bmfont/intern/BMF_BitmapFont.cpp +++ b/intern/bmfont/intern/BMF_BitmapFont.cpp @@ -241,8 +241,6 @@ void BMF_BitmapFont::DrawStringTexture(char *str, float x, float y, float z) } #define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val)) - - void BMF_BitmapFont::DrawStringBuf(char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h) { int x, y; @@ -255,11 +253,11 @@ void BMF_BitmapFont::DrawStringBuf(char *str, int posx, int posy, float *col, un posy -= m_fontData->ymin; if (buf) { - unsigned char colch[3]; + unsigned char colch[4]; unsigned char *max, *pixel; unsigned char c; - for (x=0; x<3; x++) { + for (x=0; x<4; x++) { colch[x] = FTOCHAR(col[x]); } @@ -279,6 +277,8 @@ void BMF_BitmapFont::DrawStringBuf(char *str, int posx, int posy, float *col, un pixel[0] = colch[0]; pixel[1] = colch[1]; pixel[2] = colch[2]; + pixel[4] = 1; /*colch[3];*/ + } } } @@ -310,6 +310,7 @@ void BMF_BitmapFont::DrawStringBuf(char *str, int posx, int posy, float *col, un pixel[0] = col[0]; pixel[1] = col[1]; pixel[2] = col[2]; + pixel[3] = 1; /*col[3];*/ } } } |