assimp_cmd: Fix strict-aliasing warnings

pull/1578/head
Turo Lamminen 2017-11-18 16:02:53 +02:00
parent 53119e74f8
commit 10f4b6f95c
1 changed files with 14 additions and 3 deletions

View File

@ -177,6 +177,17 @@ inline uint32_t Write<aiVector3D>(const aiVector3D& v)
return t;
}
// -----------------------------------------------------------------------------------
// Serialize a color value
template <>
inline uint32_t Write<aiColor3D>(const aiColor3D& v)
{
uint32_t t = Write<float>(v.r);
t += Write<float>(v.g);
t += Write<float>(v.b);
return t;
}
// -----------------------------------------------------------------------------------
// Serialize a color value
template <>
@ -566,9 +577,9 @@ uint32_t WriteBinaryLight(const aiLight* l)
len += Write<float>(l->mAttenuationQuadratic);
}
len += Write<aiVector3D>((const aiVector3D&)l->mColorDiffuse);
len += Write<aiVector3D>((const aiVector3D&)l->mColorSpecular);
len += Write<aiVector3D>((const aiVector3D&)l->mColorAmbient);
len += Write<aiColor3D>(l->mColorDiffuse);
len += Write<aiColor3D>(l->mColorSpecular);
len += Write<aiColor3D>(l->mColorAmbient);
if (l->mType == aiLightSource_SPOT) {
len += Write<float>(l->mAngleInnerCone);