From 1a1d611038698de62597acc5c38a542842126b75 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 11 Apr 2010 23:03:30 +0000 Subject: [PATCH] Fix overall MATKEY_UVTRANSFORM usage to use the provided AddProperty specialization for aiTextureTransform. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@673 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/COBLoader.cpp | 7 ++----- code/LWOMaterial.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/code/COBLoader.cpp b/code/COBLoader.cpp index ac71b23ab..f1567d15c 100644 --- a/code/COBLoader.cpp +++ b/code/COBLoader.cpp @@ -91,10 +91,7 @@ bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool return true; } - else if (!extension.length() || checkSig) { - if (!pIOHandler) { - return true; - } + else if ((!extension.length() || checkSig) && pIOHandler) { const char* tokens[] = {"Caligary"}; return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1); } @@ -215,7 +212,7 @@ void ConvertTexture(boost::shared_ptr< Texture > tex, MaterialHelper* out, aiTex { const aiString path( tex->path ); out->AddProperty(&path,AI_MATKEY_TEXTURE(type,0)); - out->AddProperty(&tex->transform,sizeof(aiUVTransform)/sizeof(float),AI_MATKEY_UVTRANSFORM(type,0)); + out->AddProperty(&tex->transform,1,AI_MATKEY_UVTRANSFORM(type,0)); } // ------------------------------------------------------------------------------------------------ diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp index 2ff551b99..cf76dc564 100644 --- a/code/LWOMaterial.cpp +++ b/code/LWOMaterial.cpp @@ -160,7 +160,7 @@ bool LWOImporter::HandleTextures(MaterialHelper* pcMat, const TextureList& in, a trafo.mScaling.y = (*it).wrapAmountH; BOOST_STATIC_ASSERT(sizeof(aiUVTransform)/sizeof(float) == 5); - pcMat->AddProperty((float*)&trafo,5,AI_MATKEY_UVTRANSFORM(type,cur)); + pcMat->AddProperty(&trafo,1,AI_MATKEY_UVTRANSFORM(type,cur)); } DefaultLogger::get()->debug("LWO2: Setting up non-UV mapping"); }