Fixing template instancing failure in aiMaterial::Get().

Providing explicit specialization for aiColor3D.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@470 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2009-08-23 15:46:04 +00:00
parent a251827cb9
commit 3435623463
1 changed files with 16 additions and 4 deletions

View File

@ -75,8 +75,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
{
unsigned int iNum = pMax ? *pMax : 1;
aiMaterialProperty* prop;
aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop);
const aiMaterialProperty* prop;
const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx,
(const aiMaterialProperty**)&prop);
if ( AI_SUCCESS == ret ) {
if (prop->mDataLength < sizeof(Type)*iNum) {
@ -100,8 +101,9 @@ template <typename Type>
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
unsigned int idx,Type& pOut) const
{
aiMaterialProperty* prop;
aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop);
const aiMaterialProperty* prop;
const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx,
(const aiMaterialProperty**)&prop);
if ( AI_SUCCESS == ret ) {
if (prop->mDataLength < sizeof(Type)) {
@ -156,6 +158,16 @@ inline aiReturn aiMaterial::Get<aiColor4D>(const char* pKey,unsigned int type,
}
// ---------------------------------------------------------------------------
template <>
inline aiReturn aiMaterial::Get<aiColor3D>(const char* pKey,unsigned int type,
unsigned int idx,aiColor3D& pOut) const
{
aiColor4D c;
const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c);
pOut = aiColor3D(c.r,c.g,c.b);
return ret;
}
// ---------------------------------------------------------------------------
template <>
inline aiReturn aiMaterial::Get<aiString>(const char* pKey,unsigned int type,
unsigned int idx,aiString& pOut) const
{