Merge pull request #3360 from assimp/issue_2992

closes https://github.com/assimp/assimp/issues/2992: detect double support
pull/3363/head
Kim Kulling 2020-08-07 14:41:30 +02:00 committed by GitHub
commit 4c8b9fb96d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 24 deletions

View File

@ -515,7 +515,7 @@ void WriteLogOpening(const std::string& file) {
// need to ask the authors of incoming bug reports for // need to ask the authors of incoming bug reports for
// the library version they're using - a log dump is // the library version they're using - a log dump is
// sufficient. // sufficient.
const unsigned int flags( aiGetCompileFlags() ); const unsigned int flags = aiGetCompileFlags();
std::stringstream stream; std::stringstream stream;
stream << "Assimp " << aiGetVersionMajor() << "." << aiGetVersionMinor() << "." << aiGetVersionRevision() << " " stream << "Assimp " << aiGetVersionMajor() << "." << aiGetVersionMinor() << "." << aiGetVersionRevision() << " "
#if defined(ASSIMP_BUILD_ARCHITECTURE) #if defined(ASSIMP_BUILD_ARCHITECTURE)
@ -537,11 +537,19 @@ void WriteLogOpening(const std::string& file) {
#endif #endif
<< " " << " "
#if defined(ASSIMP_BUILD_COMPILER) #if defined(ASSIMP_BUILD_COMPILER)
<< ( ASSIMP_BUILD_COMPILER ) << (ASSIMP_BUILD_COMPILER)
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
<< "msvc" << "msvc"
#elif defined(__GNUC__) #elif defined(__GNUC__)
<< "gcc" << "gcc"
#elif defined(__clang__)
<< "clang"
#elif defined(__EMSCRIPTEN__)
<< "emscripten"
#elif defined(__MINGW32__)
<< "MinGW-w64 32bit"
#elif defined(__MINGW64__)
<< "MinGW-w64 64bit"
#else #else
<< "<unknown compiler>" << "<unknown compiler>"
#endif #endif
@ -552,7 +560,8 @@ void WriteLogOpening(const std::string& file) {
<< (flags & ASSIMP_CFLAGS_NOBOOST ? " noboost" : "") << (flags & ASSIMP_CFLAGS_NOBOOST ? " noboost" : "")
<< (flags & ASSIMP_CFLAGS_SHARED ? " shared" : "") << (flags & ASSIMP_CFLAGS_SHARED ? " shared" : "")
<< (flags & ASSIMP_CFLAGS_SINGLETHREADED ? " singlethreaded" : ""); << (flags & ASSIMP_CFLAGS_SINGLETHREADED ? " singlethreaded" : "")
<< (flags & ASSIMP_CFLAGS_DOUBLE_SUPPORT ? " double : " : "single : ");
ASSIMP_LOG_DEBUG(stream.str()); ASSIMP_LOG_DEBUG(stream.str());
} }

View File

@ -104,6 +104,9 @@ ASSIMP_API unsigned int aiGetCompileFlags() {
#ifdef _STLPORT_VERSION #ifdef _STLPORT_VERSION
flags |= ASSIMP_CFLAGS_STLPORT; flags |= ASSIMP_CFLAGS_STLPORT;
#endif #endif
#ifdef ASSIMP_DOUBLE_PRECISION
flags |= ASSIMP_CFLAGS_DOUBLE_SUPPORT;
#endif
return flags; return flags;
} }
@ -113,13 +116,29 @@ ASSIMP_API unsigned int aiGetVersionRevision() {
return GitVersion; return GitVersion;
} }
// ------------------------------------------------------------------------------------------------
ASSIMP_API const char *aiGetBranchName() { ASSIMP_API const char *aiGetBranchName() {
return GitBranch; return GitBranch;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
ASSIMP_API aiScene::aiScene() : ASSIMP_API aiScene::aiScene() :
mFlags(0), mRootNode(nullptr), mNumMeshes(0), mMeshes(nullptr), mNumMaterials(0), mMaterials(nullptr), mNumAnimations(0), mAnimations(nullptr), mNumTextures(0), mTextures(nullptr), mNumLights(0), mLights(nullptr), mNumCameras(0), mCameras(nullptr), mMetaData(nullptr), mPrivate(new Assimp::ScenePrivateData()) { mFlags(0),
mRootNode(nullptr),
mNumMeshes(0),
mMeshes(nullptr),
mNumMaterials(0),
mMaterials(nullptr),
mNumAnimations(0),
mAnimations(nullptr),
mNumTextures(0),
mTextures(nullptr),
mNumLights(0),
mLights(nullptr),
mNumCameras(0),
mCameras(nullptr),
mMetaData(nullptr),
mPrivate(new Assimp::ScenePrivateData()) {
// empty // empty
} }

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team Copyright (c) 2006-2020, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
@ -91,7 +89,7 @@ ASSIMP_API unsigned int aiGetVersionMajor (void);
ASSIMP_API unsigned int aiGetVersionRevision (void); ASSIMP_API unsigned int aiGetVersionRevision (void);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** @brief Returns the branchname of the Assimp runtime. /** @brief Returns the branch-name of the Assimp runtime.
* @return The current branch name. * @return The current branch name.
*/ */
ASSIMP_API const char *aiGetBranchName(); ASSIMP_API const char *aiGetBranchName();
@ -107,12 +105,14 @@ ASSIMP_API const char *aiGetBranchName();
#define ASSIMP_CFLAGS_NOBOOST 0x8 #define ASSIMP_CFLAGS_NOBOOST 0x8
//! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined //! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined
#define ASSIMP_CFLAGS_SINGLETHREADED 0x10 #define ASSIMP_CFLAGS_SINGLETHREADED 0x10
//! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined
#define ASSIMP_CFLAGS_DOUBLE_SUPPORT 0x20
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** @brief Returns assimp's compile flags /** @brief Returns assimp's compile flags
* @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants. * @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants.
*/ */
ASSIMP_API unsigned int aiGetCompileFlags (void); ASSIMP_API unsigned int aiGetCompileFlags(void);
#ifdef __cplusplus #ifdef __cplusplus
} // end extern "C" } // end extern "C"