Merge branch 'master' into collada_makehuman_issue_3984

pull/3988/head
RichardTea 2021-07-14 11:33:43 +01:00 committed by GitHub
commit 0c6c238956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 8695 deletions

View File

@ -46,8 +46,8 @@ option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF)
IF(ASSIMP_HUNTER_ENABLED) IF(ASSIMP_HUNTER_ENABLED)
include("cmake/HunterGate.cmake") include("cmake/HunterGate.cmake")
HunterGate( HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.293.tar.gz" URL "https://github.com/cpp-pm/hunter/archive/v0.23.311.tar.gz"
SHA1 "e8e5470652db77149d9b38656db2a6c0b7642693" SHA1 "1a82b9b73055879181cb1466b2ab5d48ee8ae410"
) )
add_definitions(-DASSIMP_USE_HUNTER) add_definitions(-DASSIMP_USE_HUNTER)

View File

@ -55,6 +55,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Assimp specific M3D configuration. Comment out these defines to remove functionality // Assimp specific M3D configuration. Comment out these defines to remove functionality
//#define ASSIMP_USE_M3D_READFILECB //#define ASSIMP_USE_M3D_READFILECB
// Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy.
#define STBI_ONLY_PNG
#include <stb/stb_image.h>
#include "m3d.h" #include "m3d.h"
namespace Assimp { namespace Assimp {

File diff suppressed because it is too large Load Diff

View File

@ -873,6 +873,7 @@ ELSE()
../contrib/pugixml/src/pugiconfig.hpp ../contrib/pugixml/src/pugiconfig.hpp
../contrib/pugixml/src/pugixml.hpp ../contrib/pugixml/src/pugixml.hpp
) )
INCLUDE_DIRECTORIES("../contrib/pugixml/src")
SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS}) SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS})
ENDIF() ENDIF()
@ -1034,8 +1035,6 @@ IF(ASSIMP_HUNTER_ENABLED)
find_package(RapidJSON CONFIG REQUIRED) find_package(RapidJSON CONFIG REQUIRED)
ELSE() ELSE()
INCLUDE_DIRECTORIES("../contrib/rapidjson/include") INCLUDE_DIRECTORIES("../contrib/rapidjson/include")
INCLUDE_DIRECTORIES( "../contrib" )
INCLUDE_DIRECTORIES( "../contrib/pugixml/src" )
ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1) ADD_DEFINITIONS( -DRAPIDJSON_HAS_STDSTRING=1)
option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON ) option( ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR "Suppress rapidjson warning on MSVC (NOTE: breaks android build)" ON )
if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR) if(ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR)
@ -1043,6 +1042,18 @@ ELSE()
endif() endif()
ENDIF() ENDIF()
# stb
IF(ASSIMP_HUNTER_ENABLED)
hunter_add_package(stb)
find_package(stb CONFIG REQUIRED)
ELSE()
SET( stb_SRCS
../contrib/stb/stb_image.h
)
INCLUDE_DIRECTORIES("../contrib")
SOURCE_GROUP( Contrib\\stb FILES ${stb_SRCS})
ENDIF()
# VC2010 fixes # VC2010 fixes
if(MSVC10) if(MSVC10)
option( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF ) option( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF )
@ -1101,6 +1112,7 @@ SET( assimp_src
${open3dgc_SRCS} ${open3dgc_SRCS}
${ziplib_SRCS} ${ziplib_SRCS}
${Pugixml_SRCS} ${Pugixml_SRCS}
${stb_SRCS}
# Necessary to show the headers in the project when using the VC++ generator: # Necessary to show the headers in the project when using the VC++ generator:
${PUBLIC_HEADERS} ${PUBLIC_HEADERS}
@ -1158,6 +1170,7 @@ IF(ASSIMP_HUNTER_ENABLED)
utf8cpp utf8cpp
zip::zip zip::zip
pugixml pugixml
stb::stb
) )
if (ASSIMP_BUILD_DRACO) if (ASSIMP_BUILD_DRACO)

View File

@ -1251,3 +1251,36 @@ ASSIMP_API void aiQuaternionInterpolate(
ai_assert(nullptr != end); ai_assert(nullptr != end);
aiQuaternion::Interpolate(*dst, *start, *end, factor); aiQuaternion::Interpolate(*dst, *start, *end, factor);
} }
// stb_image is a lightweight image loader. It is shared by:
// - M3D import
// - PBRT export
// Since it's a header-only library, its implementation must be instantiated in some cpp file.
// Don't scatter this task over multiple importers/exporters. Maintain it in a central place (here!).
#define ASSIMP_HAS_PBRT_EXPORT (!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_PBRT_EXPORTER)
#define ASSIMP_HAS_M3D ((!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER)
#if ASSIMP_HAS_PBRT_EXPORT
# define ASSIMP_NEEDS_STB_IMAGE 1
#elif ASSIMP_HAS_M3D
# define ASSIMP_NEEDS_STB_IMAGE 1
# define STBI_ONLY_PNG
#endif
#if ASSIMP_NEEDS_STB_IMAGE
# if _MSC_VER // "unreferenced function has been removed" (SSE2 detection routine in x64 builds)
# pragma warning(push)
# pragma warning(disable: 4505)
# endif
# define STB_IMAGE_IMPLEMENTATION
# include "stb/stb_image.h"
# if _MSC_VER
# pragma warning(pop)
# endif
#endif

View File

@ -83,8 +83,7 @@ Other:
#include <sstream> #include <sstream>
#include <string> #include <string>
#define STB_IMAGE_IMPLEMENTATION #include "stb/stb_image.h"
#include "stb_image.h"
using namespace Assimp; using namespace Assimp;

File diff suppressed because it is too large Load Diff