just a try, i dunno have a clue ...

pull/2764/head
Kim Kulling 2019-11-16 15:51:26 +01:00
parent 2eed8b1820
commit 17257cd2ae
4 changed files with 15 additions and 12 deletions

View File

@ -107,7 +107,7 @@ LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
return nullptr;
#endif
// Platform-independent default streams
// Platform-independent default streams
case aiDefaultLogStream_STDERR:
return new StdOStreamLogStream(std::cerr);
case aiDefaultLogStream_STDOUT:
@ -121,7 +121,7 @@ LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
};
// For compilers without dead code path detection
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------------------

View File

@ -471,12 +471,12 @@ aiReturn aiMaterial::AddBinaryProperty (const void* pInput,
aiPropertyTypeInfo pType
)
{
ai_assert( pInput != NULL );
ai_assert( pKey != NULL );
ai_assert( pInput != nullptr );
ai_assert(pKey != nullptr );
ai_assert( 0 != pSizeInBytes );
if ( 0 == pSizeInBytes ) {
return AI_FAILURE;
}
// first search the list whether there is already an entry with this key

View File

@ -603,15 +603,18 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
ReportError("%s #%i is set, but there are only %i %s textures",
szType,iIndex,iNumIndices,szType);
}
if (!iNumIndices)return;
if (!iNumIndices) {
return;
}
std::vector<aiTextureMapping> mappings(iNumIndices);
// Now check whether all UV indices are valid ...
bool bNoSpecified = true;
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
{
for (unsigned int i = 0; i < pMaterial->mNumProperties;++i) {
aiMaterialProperty* prop = pMaterial->mProperties[i];
if (prop->mSemantic != type)continue;
if (prop->mSemantic != type) {
continue;
}
if ((int)prop->mIndex >= iNumIndices)
{

View File

@ -200,6 +200,9 @@ inline void SetMaterialTextureProperty(std::vector<int> &embeddedTexIdxs, Asset
uri.length = 1 + ASSIMP_itoa10(uri.data + 1, MAXLEN - 1, texIdx);
}
mat->AddProperty(&uri, AI_MATKEY_TEXTURE(texType, texSlot));
mat->AddProperty(&prop.texCoord, 1, _AI_MATKEY_GLTF_TEXTURE_TEXCOORD_BASE, texType, texSlot);
if (prop.textureTransformSupported) {
aiUVTransform transform;
transform.mTranslation.x = prop.TextureTransformExt_t.offset[0];
@ -210,9 +213,6 @@ inline void SetMaterialTextureProperty(std::vector<int> &embeddedTexIdxs, Asset
mat->AddProperty(&transform, 1, _AI_MATKEY_UVTRANSFORM_BASE, texType, texSlot);
}
mat->AddProperty(&uri, AI_MATKEY_TEXTURE(texType, texSlot));
mat->AddProperty(&prop.texCoord, 1, _AI_MATKEY_GLTF_TEXTURE_TEXCOORD_BASE, texType, texSlot);
if (prop.texture->sampler) {
Ref<Sampler> sampler = prop.texture->sampler;