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-9d2fd5bffc1fpull/1/head
parent
a251827cb9
commit
3435623463
|
@ -75,8 +75,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
|
||||||
{
|
{
|
||||||
unsigned int iNum = pMax ? *pMax : 1;
|
unsigned int iNum = pMax ? *pMax : 1;
|
||||||
|
|
||||||
aiMaterialProperty* prop;
|
const aiMaterialProperty* prop;
|
||||||
aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop);
|
const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx,
|
||||||
|
(const aiMaterialProperty**)&prop);
|
||||||
if ( AI_SUCCESS == ret ) {
|
if ( AI_SUCCESS == ret ) {
|
||||||
|
|
||||||
if (prop->mDataLength < sizeof(Type)*iNum) {
|
if (prop->mDataLength < sizeof(Type)*iNum) {
|
||||||
|
@ -100,8 +101,9 @@ template <typename Type>
|
||||||
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
|
inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
|
||||||
unsigned int idx,Type& pOut) const
|
unsigned int idx,Type& pOut) const
|
||||||
{
|
{
|
||||||
aiMaterialProperty* prop;
|
const aiMaterialProperty* prop;
|
||||||
aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,&prop);
|
const aiReturn ret = ::aiGetMaterialProperty(this,pKey,(aiTextureType)type,idx,
|
||||||
|
(const aiMaterialProperty**)&prop);
|
||||||
if ( AI_SUCCESS == ret ) {
|
if ( AI_SUCCESS == ret ) {
|
||||||
|
|
||||||
if (prop->mDataLength < sizeof(Type)) {
|
if (prop->mDataLength < sizeof(Type)) {
|
||||||
|
@ -156,6 +158,16 @@ inline aiReturn aiMaterial::Get<aiColor4D>(const char* pKey,unsigned int type,
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
template <>
|
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,
|
inline aiReturn aiMaterial::Get<aiString>(const char* pKey,unsigned int type,
|
||||||
unsigned int idx,aiString& pOut) const
|
unsigned int idx,aiString& pOut) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue