[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12374] trunk/blender/intern/bmfont/intern /BMF_BitmapFont.cpp: set the alpha value of text, so stamps are always visible in RGBA

Campbell Barton cbarton at metavr.com
Wed Oct 24 13:16:49 CEST 2007


Revision: 12374
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12374
Author:   campbellbarton
Date:     2007-10-24 13:16:48 +0200 (Wed, 24 Oct 2007)

Log Message:
-----------
set the alpha value of text, so stamps are always visible in RGBA 
images, (reported by basse)

Modified Paths:
--------------
    trunk/blender/intern/bmfont/intern/BMF_BitmapFont.cpp

Modified: trunk/blender/intern/bmfont/intern/BMF_BitmapFont.cpp
===================================================================
--- trunk/blender/intern/bmfont/intern/BMF_BitmapFont.cpp	2007-10-24 10:03:19 UTC (rev 12373)
+++ trunk/blender/intern/bmfont/intern/BMF_BitmapFont.cpp	2007-10-24 11:16:48 UTC (rev 12374)
@@ -241,8 +241,6 @@
 }
 
 #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 @@
 	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 @@
 								pixel[0] = colch[0];
 								pixel[1] = colch[1];
 								pixel[2] = colch[2];
+								pixel[4] = 1; /*colch[3];*/
+								
 							}
 						}
 					}
@@ -310,6 +310,7 @@
 								pixel[0] = col[0];
 								pixel[1] = col[1];
 								pixel[2] = col[2];
+								pixel[3] = 1; /*col[3];*/
 							}
 						}
 					}





More information about the Bf-blender-cvs mailing list