Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-17 04:42:07 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-17 04:42:07 +0400
commit6f4272a200a95587eaef3857cb6e1eeda5958e18 (patch)
tree1d79c62da4ed576a18c0314713402b9586f718c4 /source/gameengine/Converter
parent1adae69b5f7d666a34c2d2055613fd0a43406974 (diff)
Fix for bug 1245: Vertex Colours are wrong in GameBlender. 2nd try.
http://projects.blender.org/tracker/index.php?func=detail&aid=1245&group_id=9&atid=125 The member names of MCol are wrong, so we will convert to unsigned char* like the rest of blender.
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index a98d8639267..f51bf955f51 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -176,10 +176,11 @@ static unsigned int KX_Mcol2uint_new(MCol col)
/* color has to be converted without endian sensitivity. So no shifting! */
unsigned int temp=0;
unsigned char *cp= (unsigned char *)&temp;
- cp[0]= col.r;
- cp[1]= col.g;
- cp[2]= col.b;
- cp[3]= col.a;
+ unsigned char *src = (unsigned char *) &col;
+ cp[0]= src[3]; // red
+ cp[1]= src[2]; // green
+ cp[2]= src[1]; // blue
+ cp[3]= src[0]; // Alpha
return temp;
}