Browse Source

Fix usage of AI_MATKEY_UVTRANSFORM in LWO loader. The buffer was incorrectly dimensioned, random data got pulled into the material key's data section. This fixes a few failures in the regression testing suite.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@603 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 15 years ago
parent
commit
ebc03be3ac
1 changed files with 2 additions and 1 deletions
  1. 2 1
      code/LWOMaterial.cpp

+ 2 - 1
code/LWOMaterial.cpp

@@ -157,7 +157,8 @@ bool LWOImporter::HandleTextures(MaterialHelper* pcMat, const TextureList& in, a
 				trafo.mScaling.x = (*it).wrapAmountW;
 				trafo.mScaling.x = (*it).wrapAmountW;
 				trafo.mScaling.y = (*it).wrapAmountH;
 				trafo.mScaling.y = (*it).wrapAmountH;
 
 
-				pcMat->AddProperty((float*)&trafo,sizeof(aiUVTransform),AI_MATKEY_UVTRANSFORM(type,cur));
+				BOOST_STATIC_ASSERT(sizeof(aiUVTransform)/sizeof(float) == 5);
+				pcMat->AddProperty((float*)&trafo,5,AI_MATKEY_UVTRANSFORM(type,cur));
 			}
 			}
 			DefaultLogger::get()->debug("LWO2: Setting up non-UV mapping");
 			DefaultLogger::get()->debug("LWO2: Setting up non-UV mapping");
 		}
 		}