Bug fix for TF_BMFONT faces. Colors on the material were backwards when rendered.
authorCharlie Carley <snailrose@gmail.com>
Mon, 5 Feb 2007 05:48:09 +0000 (05:48 +0000)
committerCharlie Carley <snailrose@gmail.com>
Mon, 5 Feb 2007 05:48:09 +0000 (05:48 +0000)
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index bca2213fd730d2739568902f902754d52f41a7f8..ea5638a6009628b655085b6b8ec290d0156c24d9 100644 (file)
@@ -677,6 +677,16 @@ BL_Material* ConvertMaterial(
 
        unsigned int rgb[4];
        GetRGB(type,mface,mmcol,mat,rgb[0],rgb[1],rgb[2], rgb[3]);
+
+       // swap the material color, so MCol on TF_BMFONT works
+       if (validmat && type==1 && tface->mode & TF_BMFONT)
+       {
+               rgb[0] = KX_rgbaint2uint_new(rgb[0]);
+               rgb[1] = KX_rgbaint2uint_new(rgb[1]);
+               rgb[2] = KX_rgbaint2uint_new(rgb[2]);
+               rgb[3] = KX_rgbaint2uint_new(rgb[3]);
+       }
+
        material->SetConversionRGB(rgb);
        material->SetConversionUV(uv);
        material->SetConversionUV2(uv2);