From fa0951012ff31bfd3c4caeca586c4a440a365731 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 11 Nov 2020 20:32:55 +0100 Subject: [PATCH 1/2] closes https://github.com/assimp/assimp/issues/1044: fix envelope handling in lightintensity. --- code/AssetLib/LWS/LWSLoader.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/LWS/LWSLoader.cpp b/code/AssetLib/LWS/LWSLoader.cpp index 7d67c86d6..2a5cbeb8d 100644 --- a/code/AssetLib/LWS/LWSLoader.cpp +++ b/code/AssetLib/LWS/LWSLoader.cpp @@ -750,12 +750,17 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy } // 'LightIntensity': set intensity of currently active light else if ((*it).tokens[0] == "LightIntensity" || (*it).tokens[0] == "LgtIntensity") { - if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT) + if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT) { ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'LightIntensity\'"); - - else - fast_atoreal_move(c, nodes.back().lightIntensity); - + } else { + const std::string env = "(envelope)"; + if (0 == strncmp(c, env.c_str(), env.size())) { + ASSIMP_LOG_ERROR("LWS: envelopes for LightIntensity not supported, set to 1.0"); + nodes.back().lightIntensity = (ai_real)1.0; + } else { + fast_atoreal_move(c, nodes.back().lightIntensity); + } + } } // 'LightType': set type of currently active light else if ((*it).tokens[0] == "LightType") { From 75818f26ebf7d2a641eef3262b26b80f48d1b137 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 11 Nov 2020 21:13:17 +0100 Subject: [PATCH 2/2] closes https://github.com/assimp/assimp/issues/3187 Do not use pthread for android --- test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7f6d2ac86..df58846ec 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -232,6 +232,8 @@ SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} ) IF( WIN32 ) SET( platform_libs ) +ELSEIF(ANDROID) + SET( platform_libs ) ELSE() SET( platform_libs pthread ) ENDIF()