From ba6a7383b22d108a4af55f9024009871259cb202 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Mar 2019 09:45:21 +0100 Subject: [PATCH 1/9] closes https://github.com/assimp/assimp/issues/1650: build irrXml as shared lib. --- CMakeLists.txt | 3 ++- code/CMakeLists.txt | 13 ++++++------- code/FBXConverter.cpp | 2 +- code/SMDLoader.cpp | 4 ++-- code/glTF2Asset.h | 7 ++++--- contrib/irrXML/CMakeLists.txt | 2 +- contrib/irrXML/CXMLReaderImpl.h | 13 +++++++++---- contrib/irrXML/irrXML.cpp | 2 +- 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6417053ac..67e832c1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ OPTION( ASSIMP_NO_EXPORT ) OPTION( ASSIMP_BUILD_ZLIB "Build your own zlib" - OFF + OFF ) OPTION( ASSIMP_BUILD_ASSIMP_TOOLS "If the supplementary tools for Assimp are built in addition to the library." @@ -468,6 +468,7 @@ ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( ASSIMP_BUILD_SAMPLES) IF ( WIN32 ) ADD_SUBDIRECTORY( samples/SimpleTexturedOpenGL/ ) + ADD_SUBDIRECTORY( samples/SimpleTexturedDirectx11 ) ENDIF ( WIN32 ) ADD_SUBDIRECTORY( samples/SimpleOpenGL/ ) ENDIF ( ASSIMP_BUILD_SAMPLES ) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 37ad34b85..ec08d6a88 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -756,12 +756,11 @@ SET( Extra_SRCS ) SOURCE_GROUP( Extra FILES ${Extra_SRCS}) - SET( Clipper_SRCS ../contrib/clipper/clipper.hpp ../contrib/clipper/clipper.cpp ) -SOURCE_GROUP( Clipper FILES ${Clipper_SRCS}) +SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS}) SET( Poly2Tri_SRCS ../contrib/poly2tri/poly2tri/common/shapes.cc @@ -776,7 +775,7 @@ SET( Poly2Tri_SRCS ../contrib/poly2tri/poly2tri/sweep/sweep_context.cc ../contrib/poly2tri/poly2tri/sweep/sweep_context.h ) -SOURCE_GROUP( Poly2Tri FILES ${Poly2Tri_SRCS}) +SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS}) SET( unzip_SRCS ../contrib/unzip/crypt.h @@ -785,7 +784,7 @@ SET( unzip_SRCS ../contrib/unzip/unzip.c ../contrib/unzip/unzip.h ) -SOURCE_GROUP( unzip FILES ${unzip_SRCS}) +SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS}) SET( ziplib_SRCS ../contrib/zip/src/miniz.h @@ -793,7 +792,7 @@ SET( ziplib_SRCS ../contrib/zip/src/zip.h ) -SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} ) +SOURCE_GROUP( Contrib\\ziplib FILES ${ziplib_SRCS} ) SET ( openddl_parser_SRCS ../contrib/openddlparser/code/OpenDDLParser.cpp @@ -810,7 +809,7 @@ SET ( openddl_parser_SRCS ../contrib/openddlparser/include/openddlparser/DDLNode.h ../contrib/openddlparser/include/openddlparser/Value.h ) -SOURCE_GROUP( openddl_parser FILES ${openddl_parser_SRCS}) +SOURCE_GROUP( Contrib\\openddl_parser FILES ${openddl_parser_SRCS}) SET ( open3dgc_SRCS ../contrib/Open3DGC/o3dgcAdjacencyInfo.h @@ -843,7 +842,7 @@ SET ( open3dgc_SRCS ../contrib/Open3DGC/o3dgcVector.h ../contrib/Open3DGC/o3dgcVector.inl ) -SOURCE_GROUP( open3dgc FILES ${open3dgc_SRCS}) +SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS}) # Check dependencies for glTF importer with Open3DGC-compression. # RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index c556d3bba..a61ae4006 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -964,7 +964,7 @@ namespace Assimp { { if (indices[i] < 0) epcount++; } - unsigned int pcount = indices.size(); + unsigned int pcount = static_cast( indices.size() ); unsigned int scount = out_mesh->mNumFaces = pcount - epcount; aiFace* fac = out_mesh->mFaces = new aiFace[scount](); diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index 00d92e0b4..4185c3400 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -486,7 +486,7 @@ void SMDImporter::CreateOutputAnimations(const std::string &pFile, IOSystem* pIO if (bLoadAnimationList) { GetAnimationFileList(pFile, pIOHandler, animFileList); } - int animCount = animFileList.size() + 1; + int animCount = static_cast( animFileList.size() ) + 1; pScene->mNumAnimations = 1; pScene->mAnimations = new aiAnimation*[animCount]; memset(pScene->mAnimations, 0, sizeof(aiAnimation*)*animCount); @@ -510,7 +510,7 @@ void SMDImporter::CreateOutputAnimation(int index, const std::string &name) { anim->mName.Set(name.c_str()); } anim->mDuration = dLengthOfAnim; - anim->mNumChannels = asBones.size(); + anim->mNumChannels = static_cast( asBones.size() ); anim->mTicksPerSecond = 25.0; // FIXME: is this correct? aiNodeAnim** pp = anim->mChannels = new aiNodeAnim*[anim->mNumChannels]; diff --git a/code/glTF2Asset.h b/code/glTF2Asset.h index 0015197c2..2937c0ce9 100644 --- a/code/glTF2Asset.h +++ b/code/glTF2Asset.h @@ -223,7 +223,8 @@ namespace glTF2 ComponentType_FLOAT = 5126 }; - inline unsigned int ComponentTypeSize(ComponentType t) + inline + unsigned int ComponentTypeSize(ComponentType t) { switch (t) { case ComponentType_SHORT: @@ -250,7 +251,7 @@ namespace glTF2 }; //! Values for the Sampler::magFilter field - enum class SamplerMagFilter: unsigned int + enum class SamplerMagFilter : unsigned int { UNSET = 0, SamplerMagFilter_Nearest = 9728, @@ -258,7 +259,7 @@ namespace glTF2 }; //! Values for the Sampler::minFilter field - enum class SamplerMinFilter: unsigned int + enum class SamplerMinFilter : unsigned int { UNSET = 0, SamplerMinFilter_Nearest = 9728, diff --git a/contrib/irrXML/CMakeLists.txt b/contrib/irrXML/CMakeLists.txt index 48941970a..ef3ce1478 100644 --- a/contrib/irrXML/CMakeLists.txt +++ b/contrib/irrXML/CMakeLists.txt @@ -13,7 +13,7 @@ if ( MSVC ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) endif ( MSVC ) -add_library(IrrXML STATIC ${IrrXML_SRCS}) +add_library(IrrXML ${IrrXML_SRCS}) set(IRRXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "IrrXML_Include" ) set(IRRXML_LIBRARY "IrrXML" CACHE INTERNAL "IrrXML" ) diff --git a/contrib/irrXML/CXMLReaderImpl.h b/contrib/irrXML/CXMLReaderImpl.h index 7d33b9404..6f3bec5fa 100644 --- a/contrib/irrXML/CXMLReaderImpl.h +++ b/contrib/irrXML/CXMLReaderImpl.h @@ -10,8 +10,11 @@ #include "irrArray.h" #include +#include +#include +#include +//using namespace Assimp; -using namespace Assimp; #ifdef _DEBUG #define IRR_DEBUGPRINT(x) printf((x)); @@ -162,7 +165,8 @@ public: return 0; core::stringc c = attr->Value.c_str(); - return fast_atof(c.c_str()); + return static_cast(atof(c.c_str())); + //return fast_atof(c.c_str()); } @@ -174,7 +178,8 @@ public: return 0; core::stringc c = attrvalue; - return fast_atof(c.c_str()); + return static_cast(atof(c.c_str())); + //return fast_atof(c.c_str()); } @@ -428,7 +433,7 @@ private: ++P; // remove trailing whitespace, if any - while( isspace( P[-1])) + while( std::isspace( P[-1])) --P; NodeName = core::string(pBeginClose, (int)(P - pBeginClose)); diff --git a/contrib/irrXML/irrXML.cpp b/contrib/irrXML/irrXML.cpp index 532eed544..609d51359 100644 --- a/contrib/irrXML/irrXML.cpp +++ b/contrib/irrXML/irrXML.cpp @@ -9,7 +9,7 @@ #include "irrXML.h" #include "irrString.h" #include "irrArray.h" -#include +//#include #include "CXMLReaderImpl.h" namespace irr From e9b6a4895d06a24cc0c5b9a37ab913b72a63f581 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Mar 2019 15:32:47 +0100 Subject: [PATCH 2/9] Fix the build. --- contrib/irrXML/CMakeLists.txt | 2 +- contrib/irrXML/irrXML.cpp | 2 +- contrib/irrXML/irrXML.h | 24 +++++++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/contrib/irrXML/CMakeLists.txt b/contrib/irrXML/CMakeLists.txt index ef3ce1478..7518e382a 100644 --- a/contrib/irrXML/CMakeLists.txt +++ b/contrib/irrXML/CMakeLists.txt @@ -13,7 +13,7 @@ if ( MSVC ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) endif ( MSVC ) -add_library(IrrXML ${IrrXML_SRCS}) +add_library(IrrXML SHARED ${IrrXML_SRCS}) set(IRRXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "IrrXML_Include" ) set(IRRXML_LIBRARY "IrrXML" CACHE INTERNAL "IrrXML" ) diff --git a/contrib/irrXML/irrXML.cpp b/contrib/irrXML/irrXML.cpp index 609d51359..5a4b04507 100644 --- a/contrib/irrXML/irrXML.cpp +++ b/contrib/irrXML/irrXML.cpp @@ -18,7 +18,7 @@ namespace io { //! Implementation of the file read callback for ordinary files -class CFileReadCallBack : public IFileReadCallBack +class IRRXML_API CFileReadCallBack : public IFileReadCallBack { public: diff --git a/contrib/irrXML/irrXML.h b/contrib/irrXML/irrXML.h index b51ddeb54..abf1e1869 100644 --- a/contrib/irrXML/irrXML.h +++ b/contrib/irrXML/irrXML.h @@ -7,6 +7,12 @@ #include +#ifdef _WIN32 +# define IRRXML_API __declspec(dllexport) +#else +# define IRRXML_API +#endif _WIN32 + /** \mainpage irrXML 1.2 API documentation
@@ -409,7 +415,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReader* createIrrXMLReader(const char* filename); + IRRXML_API IrrXMLReader* createIrrXMLReader(const char* filename); //! Creates an instance of an UFT-8 or ASCII character xml parser. /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can @@ -421,7 +427,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReader* createIrrXMLReader(FILE* file); + IRRXML_API IrrXMLReader* createIrrXMLReader(FILE* file); //! Creates an instance of an UFT-8 or ASCII character xml parser. /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can @@ -434,7 +440,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback); + IRRXML_API IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback); //! Creates an instance of an UFT-16 xml parser. /** This means that @@ -446,7 +452,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename); + IRRXML_API IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename); //! Creates an instance of an UFT-16 xml parser. /** This means that all character data will be returned in UTF-16. The file to read can @@ -458,7 +464,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file); + IRRXML_API IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file); //! Creates an instance of an UFT-16 xml parser. /** This means that all character data will be returned in UTF-16. The file to read can @@ -471,7 +477,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback); + IRRXML_API IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback); //! Creates an instance of an UFT-32 xml parser. @@ -483,7 +489,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename); + IRRXML_API IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename); //! Creates an instance of an UFT-32 xml parser. /** This means that all character data will be returned in UTF-32. The file to read can @@ -495,7 +501,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file); + IRRXML_API IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file); //! Creates an instance of an UFT-32 xml parser. /** This means that @@ -509,7 +515,7 @@ namespace io \return Returns a pointer to the created xml parser. This pointer should be deleted using 'delete' after no longer needed. Returns 0 if an error occured and the file could not be opened. */ - IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback); + IRRXML_API IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback); /*! \file irrxml.h From f4ec02a34bd9304d3a435178d4328f95630f8677 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Mar 2019 16:10:30 +0100 Subject: [PATCH 3/9] Fix install folders for cmake - os files. --- contrib/irrXML/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/irrXML/CMakeLists.txt b/contrib/irrXML/CMakeLists.txt index 7518e382a..dbe580429 100644 --- a/contrib/irrXML/CMakeLists.txt +++ b/contrib/irrXML/CMakeLists.txt @@ -18,5 +18,8 @@ set(IRRXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "IrrXML_Incl set(IRRXML_LIBRARY "IrrXML" CACHE INTERNAL "IrrXML" ) install(TARGETS IrrXML + LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} + FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} COMPONENT ${LIBASSIMP_COMPONENT}) From a3fdb46f670558e5f987f88184f6f14b11cf4c32 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Mar 2019 17:02:38 +0100 Subject: [PATCH 4/9] fix typo. --- contrib/irrXML/irrXML.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/irrXML/irrXML.h b/contrib/irrXML/irrXML.h index abf1e1869..5aa19e4a7 100644 --- a/contrib/irrXML/irrXML.h +++ b/contrib/irrXML/irrXML.h @@ -11,7 +11,7 @@ # define IRRXML_API __declspec(dllexport) #else # define IRRXML_API -#endif _WIN32 +#endif // _WIN32 /** \mainpage irrXML 1.2 API documentation
From 525566b8b896abef6bdc4f3cfcfd5d2e4147abc7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Mar 2019 18:36:26 +0100 Subject: [PATCH 5/9] try to fix shared object issue. --- contrib/irrXML/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/irrXML/CMakeLists.txt b/contrib/irrXML/CMakeLists.txt index dbe580429..56a7c7e6d 100644 --- a/contrib/irrXML/CMakeLists.txt +++ b/contrib/irrXML/CMakeLists.txt @@ -13,7 +13,7 @@ if ( MSVC ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) endif ( MSVC ) -add_library(IrrXML SHARED ${IrrXML_SRCS}) +add_library(IrrXML ${IrrXML_SRCS}) set(IRRXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "IrrXML_Include" ) set(IRRXML_LIBRARY "IrrXML" CACHE INTERNAL "IrrXML" ) From b3177a2a9a8c3f1455d3894490f7afc7b933db72 Mon Sep 17 00:00:00 2001 From: Matias Lavik Date: Sat, 6 Apr 2019 19:31:56 +0200 Subject: [PATCH 6/9] issue 1957: Added support for reading embedded content (textures) in ASCII FBX. In ASCII FBX embedded content is encoded in Base64 and is surrounded by double quotation marks. The decoding functions are based on those used in the glTF importer. --- code/FBXMaterial.cpp | 18 +++++++++++++++++- code/FBXUtil.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ code/FBXUtil.h | 14 ++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/code/FBXMaterial.cpp b/code/FBXMaterial.cpp index f5f6fda03..1b05673f4 100644 --- a/code/FBXMaterial.cpp +++ b/code/FBXMaterial.cpp @@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include // std::transform +#include "FBXUtil.h" namespace Assimp { namespace FBX { @@ -307,7 +308,22 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std const Token& token = GetRequiredToken(*Content, 0); const char* data = token.begin(); if (!token.IsBinary()) { - DOMWarning("video content is not binary data, ignoring", &element); + if (*data != '"') { + DOMError("embedded content is not surrounded by quotation marks", &element); + } + else { + const char* encodedData = data + 1; + size_t encodedDataLen = static_cast(token.end() - token.begin()); + // search for last quotation mark + while (encodedDataLen > 1 && encodedData[encodedDataLen] != '"') + encodedDataLen--; + if (encodedDataLen % 4 != 0) { + DOMError("embedded content is invalid, needs to be in base64", &element); + } + else { + contentLength = Util::DecodeBase64(encodedData, encodedDataLen, content); + } + } } else if (static_cast(token.end() - data) < 5) { DOMError("binary data array is too short, need five (5) bytes for type signature and element count", &element); diff --git a/code/FBXUtil.cpp b/code/FBXUtil.cpp index c184c4a00..1a9bea914 100644 --- a/code/FBXUtil.cpp +++ b/code/FBXUtil.cpp @@ -113,6 +113,49 @@ std::string AddTokenText(const std::string& prefix, const std::string& text, con text) ); } +static const uint8_t base64DecodeTable[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 64, 0, 0, + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, + 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0 +}; + +uint8_t DecodeBase64(char ch) +{ + return base64DecodeTable[ch]; +} + +size_t DecodeBase64(const char* in, size_t inLength, uint8_t*& out) +{ + if (inLength < 4) { + out = 0; + return 0; + } + + const size_t outLength = (inLength * 3) / 4; + out = new uint8_t[outLength]; + memset(out, 0, outLength); + + size_t i = 0; + size_t j = 0; + for (i = 0; i < inLength - 4; i += 4) + { + uint8_t b0 = Util::DecodeBase64(in[i]); + uint8_t b1 = Util::DecodeBase64(in[i + 1]); + uint8_t b2 = Util::DecodeBase64(in[i + 2]); + uint8_t b3 = Util::DecodeBase64(in[i + 3]); + + out[j++] = (uint8_t)((b0 << 2) | (b1 >> 4)); + out[j++] = (uint8_t)((b1 << 4) | (b2 >> 2)); + out[j++] = (uint8_t)((b2 << 6) | b3); + } + return outLength; +} + } // !Util } // !FBX } // !Assimp diff --git a/code/FBXUtil.h b/code/FBXUtil.h index 1a37d346b..2b19b9e4f 100644 --- a/code/FBXUtil.h +++ b/code/FBXUtil.h @@ -98,6 +98,20 @@ std::string AddLineAndColumn(const std::string& prefix, const std::string& text, * @return A string of the following format: {prefix} ({token-type}, line {line}, col {column}) {text}*/ std::string AddTokenText(const std::string& prefix, const std::string& text, const Token* tok); +/** Decode a single Base64-encoded character. +* +* @param ch Character to decode (from base64 to binary). +* @return decoded byte value*/ +uint8_t DecodeBase64(char ch); + +/** Decode a Base64-encoded string +* +* @param in Characters to decode. +* @param inLength Number of characters to decode. +* @param out Reference to pointer where we will store the decoded data. +* @return size of the decoded data (number of bytes)*/ +size_t DecodeBase64(const char* in, size_t inLength, uint8_t*& out); + } } } From fac392d6cbb1e53a73c3906ca95460d7e42a8fe3 Mon Sep 17 00:00:00 2001 From: Matias Lavik Date: Sat, 6 Apr 2019 23:44:14 +0200 Subject: [PATCH 7/9] Added missing include and fixed a mistake --- code/FBXUtil.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/FBXUtil.cpp b/code/FBXUtil.cpp index 1a9bea914..fb483161b 100644 --- a/code/FBXUtil.cpp +++ b/code/FBXUtil.cpp @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #ifndef ASSIMP_BUILD_NO_FBX_IMPORTER @@ -126,7 +127,7 @@ static const uint8_t base64DecodeTable[128] = { uint8_t DecodeBase64(char ch) { - return base64DecodeTable[ch]; + return base64DecodeTable[size_t(ch)]; } size_t DecodeBase64(const char* in, size_t inLength, uint8_t*& out) From ddfc140fc3e0b31dfcac5e4df5397ce48ff538eb Mon Sep 17 00:00:00 2001 From: Matias Lavik Date: Sun, 7 Apr 2019 00:02:22 +0200 Subject: [PATCH 8/9] Added -include --- code/FBXUtil.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/FBXUtil.h b/code/FBXUtil.h index 2b19b9e4f..6890e015b 100644 --- a/code/FBXUtil.h +++ b/code/FBXUtil.h @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXCompileConfig.h" #include "FBXTokenizer.h" +#include namespace Assimp { namespace FBX { From 37357515fafef0aa4d6711690ceaaceb826d5c15 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 8 Apr 2019 12:49:07 +0200 Subject: [PATCH 9/9] Update irrXML.h FIx export directive for linux. --- contrib/irrXML/irrXML.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/irrXML/irrXML.h b/contrib/irrXML/irrXML.h index 5aa19e4a7..d596ec062 100644 --- a/contrib/irrXML/irrXML.h +++ b/contrib/irrXML/irrXML.h @@ -8,9 +8,9 @@ #include #ifdef _WIN32 -# define IRRXML_API __declspec(dllexport) +# define IRRXML_API __declspec(dllexport) #else -# define IRRXML_API +# define IRRXML_API __attribute__ ((visibility("default"))) #endif // _WIN32 /** \mainpage irrXML 1.2 API documentation