forked from bartvdbraak/blender
set the alpha value of text, so stamps are always visible in RGBA
images, (reported by basse)
This commit is contained in:
parent
2339eacce8
commit
14bbff61fe
@ -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];*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user