summaryrefslogtreecommitdiff
path: root/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-06 14:42:31 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-06 14:43:31 +0100
commit78b22393a8dd182ee56d0448ed77ba4430de5e75 (patch)
treeb117ded652a479692041ba5cafba15cfc2a754b5 /thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp
parent9d8a9ea826ac733e7076d567ef2a6b5200de68c4 (diff)
assimp: Sync with upstream 0201fc5
Diffstat (limited to 'thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp')
-rw-r--r--thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp
index 75d1b6ef78..6212bfb690 100644
--- a/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp
+++ b/thirdparty/assimp/code/PostProcessing/ValidateDataStructure.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2019, assimp team
+Copyright (c) 2006-2020, assimp team
@@ -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)
{
@@ -634,7 +637,7 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
ReportError("Material property %s%i is expected to be 5 floats large (size is %i)",
prop->mKey.data,prop->mIndex, prop->mDataLength);
}
- mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
+ //mappings[prop->mIndex] = ((aiUVTransform*)prop->mData);
}
else if (!::strcmp(prop->mKey.data,"$tex.uvwsrc")) {
if (aiPTI_Integer != prop->mType || sizeof(int) > prop->mDataLength)
@@ -774,6 +777,12 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
SearchForInvalidTextures(pMaterial,aiTextureType_DISPLACEMENT);
SearchForInvalidTextures(pMaterial,aiTextureType_LIGHTMAP);
SearchForInvalidTextures(pMaterial,aiTextureType_REFLECTION);
+ SearchForInvalidTextures(pMaterial,aiTextureType_BASE_COLOR);
+ SearchForInvalidTextures(pMaterial,aiTextureType_NORMAL_CAMERA);
+ SearchForInvalidTextures(pMaterial,aiTextureType_EMISSION_COLOR);
+ SearchForInvalidTextures(pMaterial,aiTextureType_METALNESS);
+ SearchForInvalidTextures(pMaterial,aiTextureType_DIFFUSE_ROUGHNESS);
+ SearchForInvalidTextures(pMaterial,aiTextureType_AMBIENT_OCCLUSION);
}
// ------------------------------------------------------------------------------------------------
@@ -795,7 +804,7 @@ void ValidateDSProcess::Validate( const aiTexture* pTexture)
if (!pTexture->mWidth) {
ReportError("aiTexture::mWidth is zero (compressed texture)");
}
- if ('\0' != pTexture->achFormatHint[3]) {
+ if ('\0' != pTexture->achFormatHint[HINTMAXTEXTURELEN - 1]) {
ReportWarning("aiTexture::achFormatHint must be zero-terminated");
}
else if ('.' == pTexture->achFormatHint[0]) {