- extract MaterialHelper and move all of its members to aiMaterial in /include.
- pull in IOhannes' patch to set the gcc default visibility for all symbols to NO and to mark ASSIMP_API with __attribute__ ((visibility("default"))).
- drop unneeded ASSIMP_API from most internal classes in /code, we just need to keep some exports on Windows to keep AssimpView alive.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1066 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "RemoveRedundantMaterials.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "MaterialSystem.h"
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
@@ -114,7 +115,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
// Our brilliant 'salt': A single material property with ~ as first
|
||||
// character to mark it as internal and temporary.
|
||||
const int dummy = 1;
|
||||
((MaterialHelper*)mat)->AddProperty(&dummy,1,"~RRM.UniqueMaterial",0,0);
|
||||
((aiMaterial*)mat)->AddProperty(&dummy,1,"~RRM.UniqueMaterial",0,0);
|
||||
|
||||
// Keep this material even if no mesh references it
|
||||
abReferenced[i] = true;
|
||||
@@ -144,7 +145,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t me = aiHashes[i] = ((MaterialHelper*)pScene->mMaterials[i])->ComputeHash();
|
||||
uint32_t me = aiHashes[i] = ComputeMaterialHash(pScene->mMaterials[i]);
|
||||
for (unsigned int a = 0; a < i;++a)
|
||||
{
|
||||
if (abReferenced[a] && me == aiHashes[a]) {
|
||||
@@ -175,7 +176,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
{
|
||||
aiString sz;
|
||||
sz.length = ::sprintf(sz.data,"JoinedMaterial_#%i",p);
|
||||
((MaterialHelper*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
}
|
||||
else ppcMaterials[idx] = pScene->mMaterials[p];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user