diff --git a/D3D11Engine/include/assimp/AssertHandler.h b/D3D11Engine/include/assimp/AssertHandler.h new file mode 100644 index 00000000..1247ff49 --- /dev/null +++ b/D3D11Engine/include/assimp/AssertHandler.h @@ -0,0 +1,79 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +/** @file Provides facilities to replace the default assert handler. */ + +#ifndef INCLUDED_AI_ASSERTHANDLER_H +#define INCLUDED_AI_ASSERTHANDLER_H + +#include +#include + +namespace Assimp { + +// --------------------------------------------------------------------------- +/** + * @brief Signature of functions which handle assert violations. + */ +using AiAssertHandler = void (*)(const char* failedExpression, const char* file, int line); + +// --------------------------------------------------------------------------- +/** + * @brief Set the assert handler. + */ +ASSIMP_API void setAiAssertHandler(AiAssertHandler handler); + +// --------------------------------------------------------------------------- +/** The assert handler which is set by default. + * + * @brief This issues a message to stderr and calls abort. + */ +AI_WONT_RETURN ASSIMP_API void defaultAiAssertHandler(const char* failedExpression, const char* file, int line) AI_WONT_RETURN_SUFFIX; + +// --------------------------------------------------------------------------- +/** + * @brief Dispatches an assert violation to the assert handler. + */ +ASSIMP_API void aiAssertViolation(const char* failedExpression, const char* file, int line); + +} // end of namespace Assimp + +#endif // INCLUDED_AI_ASSERTHANDLER_H diff --git a/D3D11Engine/include/assimp/Base64.hpp b/D3D11Engine/include/assimp/Base64.hpp new file mode 100644 index 00000000..10288713 --- /dev/null +++ b/D3D11Engine/include/assimp/Base64.hpp @@ -0,0 +1,92 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2022, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#pragma once +#ifndef AI_BASE64_HPP_INC +#define AI_BASE64_HPP_INC + +#include + +#include +#include +#include + +namespace Assimp { +namespace Base64 { + +/// @brief Will encode the given character buffer from UTF64 to ASCII +/// @param in The UTF-64 buffer. +/// @param inLength The size of the buffer +/// @param out The encoded ASCII string. +ASSIMP_API void Encode(const uint8_t *in, size_t inLength, std::string &out); + +/// @brief Will encode the given character buffer from UTF64 to ASCII. +/// @param in A vector, which contains the buffer for encoding. +/// @param out The encoded ASCII string. +ASSIMP_API void Encode(const std::vector &in, std::string &out); + +/// @brief Will encode the given character buffer from UTF64 to ASCII. +/// @param in A vector, which contains the buffer for encoding. +/// @return The encoded ASCII string. +ASSIMP_API std::string Encode(const std::vector &in); + +/// @brief Will decode the given character buffer from ASCII to UTF64. +/// @param in The ASCII buffer to decode. +/// @param inLength The size of the buffer. +/// @param out The decoded buffer. +/// @return The new buffer size. +ASSIMP_API size_t Decode(const char *in, size_t inLength, uint8_t *&out); + +/// @brief Will decode the given character buffer from ASCII to UTF64. +/// @param in The ASCII buffer to decode as a std::string. +/// @param out The decoded buffer. +/// @return The new buffer size. +ASSIMP_API size_t Decode(const std::string &in, std::vector &out); + +/// @brief Will decode the given character buffer from ASCII to UTF64. +/// @param in The ASCII string. +/// @return The decoded buffer in a vector. +ASSIMP_API std::vector Decode(const std::string &in); + +} // namespace Base64 +} // namespace Assimp + +#endif // AI_BASE64_HPP_INC diff --git a/D3D11Engine/include/assimp/BaseImporter.h b/D3D11Engine/include/assimp/BaseImporter.h index 656e0f16..d0b17317 100644 --- a/D3D11Engine/include/assimp/BaseImporter.h +++ b/D3D11Engine/include/assimp/BaseImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include @@ -95,20 +96,15 @@ class ASSIMP_API BaseImporter { // ------------------------------------------------------------------- /** Returns whether the class can handle the format of the given file. * - * The implementation should be as quick as possible. A check for - * the file extension is enough. If no suitable loader is found with - * this strategy, CanRead() is called again, the 'checkSig' parameter - * set to true this time. Now the implementation is expected to - * perform a full check of the file structure, possibly searching the - * first bytes of the file for magic identifiers or keywords. + * The implementation is expected to perform a full check of the file + * structure, possibly searching the first bytes of the file for magic + * identifiers or keywords. * * @param pFile Path and file name of the file to be examined. * @param pIOHandler The IO handler to use for accessing any file. - * @param checkSig Set to true if this method is called a second time. - * This time, the implementation may take more time to examine the - * contents of the file to be loaded for magic bytes, keywords, etc - * to be able to load files with unknown/not existent file extensions. - * @return true if the class can read this file, false if not. + * @param checkSig Legacy; do not use. + * @return true if the class can read this file, false if not or if + * unsure. */ virtual bool CanRead( const std::string &pFile, @@ -259,11 +255,11 @@ class ASSIMP_API BaseImporter { static bool SearchFileHeaderForToken( IOSystem *pIOSystem, const std::string &file, - const char * const *tokens, - unsigned int numTokens, + const char **tokens, + std::size_t numTokens, unsigned int searchBytes = 200, bool tokensSol = false, - bool noAlphaBeforeTokens = false); + bool noGraphBeforeTokens = false); // ------------------------------------------------------------------- /** @brief Check whether a file has a specific file extension @@ -279,6 +275,16 @@ class ASSIMP_API BaseImporter { const char *ext1 = nullptr, const char *ext2 = nullptr); + // ------------------------------------------------------------------- + /** @brief Check whether a file has one of the passed file extensions + * @param pFile Input file + * @param extensions Extensions to check for. Lowercase characters only, no dot! + * @note Case-insensitive + */ + static bool HasExtension( + const std::string &pFile, + const std::set &extensions); + // ------------------------------------------------------------------- /** @brief Extract file extension from a string * @param pFile Input file @@ -305,7 +311,7 @@ class ASSIMP_API BaseImporter { IOSystem *pIOHandler, const std::string &pFile, const void *magic, - unsigned int num, + std::size_t num, unsigned int offset = 0, unsigned int size = 4); diff --git a/D3D11Engine/include/assimp/Bitmap.h b/D3D11Engine/include/assimp/Bitmap.h index 228f6e9b..2678b5f6 100644 --- a/D3D11Engine/include/assimp/Bitmap.h +++ b/D3D11Engine/include/assimp/Bitmap.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -63,7 +63,7 @@ namespace Assimp { class IOStream; // --------------------------------------------------------------------------- -/** +/** * This class is used to store and write bitmap information. */ class ASSIMP_API Bitmap { @@ -78,11 +78,11 @@ class ASSIMP_API Bitmap { // We define the struct size because sizeof(Header) might return a wrong result because of structure padding. static constexpr std::size_t header_size = - sizeof(type) + - sizeof(size) + - sizeof(reserved1) + - sizeof(reserved2) + - sizeof(offset); + sizeof(uint16_t) + + sizeof(uint32_t) + + sizeof(uint16_t) + + sizeof(uint16_t) + + sizeof(uint32_t); }; struct DIB { @@ -100,17 +100,17 @@ class ASSIMP_API Bitmap { // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding. static constexpr std::size_t dib_size = - sizeof(size) + - sizeof(width) + - sizeof(height) + - sizeof(planes) + - sizeof(bits_per_pixel) + - sizeof(compression) + - sizeof(image_size) + - sizeof(x_resolution) + - sizeof(y_resolution) + - sizeof(nb_colors) + - sizeof(nb_important_colors); + sizeof(uint32_t) + + sizeof(int32_t) + + sizeof(int32_t) + + sizeof(uint16_t) + + sizeof(uint16_t) + + sizeof(uint32_t) + + sizeof(uint32_t) + + sizeof(int32_t) + + sizeof(int32_t) + + sizeof(uint32_t) + + sizeof(uint32_t); }; static constexpr std::size_t mBytesPerPixel = 4; diff --git a/D3D11Engine/include/assimp/BlobIOSystem.h b/D3D11Engine/include/assimp/BlobIOSystem.h index da220b69..7e8d46a5 100644 --- a/D3D11Engine/include/assimp/BlobIOSystem.h +++ b/D3D11Engine/include/assimp/BlobIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/ByteSwapper.h b/D3D11Engine/include/assimp/ByteSwapper.h index 94df04b7..488f7a51 100644 --- a/D3D11Engine/include/assimp/ByteSwapper.h +++ b/D3D11Engine/include/assimp/ByteSwapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -211,7 +211,7 @@ template struct ByteSwap::_swapper { // -------------------------------------------------------------------------------------- #if (defined AI_BUILD_BIG_ENDIAN) # define AI_LE(t) (t) -# define AI_BE(t) ByteSwap::Swapped(t) +# define AI_BE(t) Assimp::ByteSwap::Swapped(t) # define AI_LSWAP2(p) # define AI_LSWAP4(p) # define AI_LSWAP8(p) @@ -219,16 +219,16 @@ template struct ByteSwap::_swapper { # define AI_LSWAP4P(p) # define AI_LSWAP8P(p) # define LE_NCONST const -# define AI_SWAP2(p) ByteSwap::Swap2(&(p)) -# define AI_SWAP4(p) ByteSwap::Swap4(&(p)) -# define AI_SWAP8(p) ByteSwap::Swap8(&(p)) -# define AI_SWAP2P(p) ByteSwap::Swap2((p)) -# define AI_SWAP4P(p) ByteSwap::Swap4((p)) -# define AI_SWAP8P(p) ByteSwap::Swap8((p)) +# define AI_SWAP2(p) Assimp::ByteSwap::Swap2(&(p)) +# define AI_SWAP4(p) Assimp::ByteSwap::Swap4(&(p)) +# define AI_SWAP8(p) Assimp::ByteSwap::Swap8(&(p)) +# define AI_SWAP2P(p) Assimp::ByteSwap::Swap2((p)) +# define AI_SWAP4P(p) Assimp::ByteSwap::Swap4((p)) +# define AI_SWAP8P(p) Assimp::ByteSwap::Swap8((p)) # define BE_NCONST #else # define AI_BE(t) (t) -# define AI_LE(t) ByteSwap::Swapped(t) +# define AI_LE(t) Assimp::ByteSwap::Swapped(t) # define AI_SWAP2(p) # define AI_SWAP4(p) # define AI_SWAP8(p) @@ -236,12 +236,12 @@ template struct ByteSwap::_swapper { # define AI_SWAP4P(p) # define AI_SWAP8P(p) # define BE_NCONST const -# define AI_LSWAP2(p) ByteSwap::Swap2(&(p)) -# define AI_LSWAP4(p) ByteSwap::Swap4(&(p)) -# define AI_LSWAP8(p) ByteSwap::Swap8(&(p)) -# define AI_LSWAP2P(p) ByteSwap::Swap2((p)) -# define AI_LSWAP4P(p) ByteSwap::Swap4((p)) -# define AI_LSWAP8P(p) ByteSwap::Swap8((p)) +# define AI_LSWAP2(p) Assimp::ByteSwap::Swap2(&(p)) +# define AI_LSWAP4(p) Assimp::ByteSwap::Swap4(&(p)) +# define AI_LSWAP8(p) Assimp::ByteSwap::Swap8(&(p)) +# define AI_LSWAP2P(p) Assimp::ByteSwap::Swap2((p)) +# define AI_LSWAP4P(p) Assimp::ByteSwap::Swap4((p)) +# define AI_LSWAP8P(p) Assimp::ByteSwap::Swap8((p)) # define LE_NCONST #endif diff --git a/D3D11Engine/include/assimp/ColladaMetaData.h b/D3D11Engine/include/assimp/ColladaMetaData.h index de5963b3..52eb3c50 100644 --- a/D3D11Engine/include/assimp/ColladaMetaData.h +++ b/D3D11Engine/include/assimp/ColladaMetaData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/CreateAnimMesh.h b/D3D11Engine/include/assimp/CreateAnimMesh.h index 868a1f39..e5211f50 100644 --- a/D3D11Engine/include/assimp/CreateAnimMesh.h +++ b/D3D11Engine/include/assimp/CreateAnimMesh.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/DefaultIOStream.h b/D3D11Engine/include/assimp/DefaultIOStream.h index 9e0a4862..67cba3c5 100644 --- a/D3D11Engine/include/assimp/DefaultIOStream.h +++ b/D3D11Engine/include/assimp/DefaultIOStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -74,7 +74,7 @@ class ASSIMP_API DefaultIOStream : public IOStream { #endif // __ANDROID__ protected: - /// @brief + /// @brief DefaultIOStream() AI_NO_EXCEPT; /// @brief The class constructor with the file name and the stream. @@ -84,7 +84,7 @@ class ASSIMP_API DefaultIOStream : public IOStream { public: /** Destructor public to allow simple deletion to close the file. */ - ~DefaultIOStream (); + ~DefaultIOStream () override; // ------------------------------------------------------------------- /// Read from stream diff --git a/D3D11Engine/include/assimp/DefaultIOSystem.h b/D3D11Engine/include/assimp/DefaultIOSystem.h index 2e5d0aac..8545e75c 100644 --- a/D3D11Engine/include/assimp/DefaultIOSystem.h +++ b/D3D11Engine/include/assimp/DefaultIOSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/DefaultLogger.hpp b/D3D11Engine/include/assimp/DefaultLogger.hpp index a83aedbd..723097ff 100644 --- a/D3D11Engine/include/assimp/DefaultLogger.hpp +++ b/D3D11Engine/include/assimp/DefaultLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/Exceptional.h b/D3D11Engine/include/assimp/Exceptional.h index 3078de9f..ec3d38c5 100644 --- a/D3D11Engine/include/assimp/Exceptional.h +++ b/D3D11Engine/include/assimp/Exceptional.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -98,10 +98,6 @@ class ASSIMP_API DeadlyImportError : public DeadlyErrorBase { DeadlyErrorBase(Assimp::Formatter::format(), std::forward(args)...) { // empty } - -#if defined(_MSC_VER) && defined(__clang__) - DeadlyImportError(DeadlyImportError& other) = delete; -#endif }; // --------------------------------------------------------------------------- @@ -114,10 +110,6 @@ class ASSIMP_API DeadlyExportError : public DeadlyErrorBase { template explicit DeadlyExportError(T&&... args) : DeadlyErrorBase(Assimp::Formatter::format(), std::forward(args)...) {} - -#if defined(_MSC_VER) && defined(__clang__) - DeadlyExportError(DeadlyExportError& other) = delete; -#endif }; #ifdef _MSC_VER diff --git a/D3D11Engine/include/assimp/Exporter.hpp b/D3D11Engine/include/assimp/Exporter.hpp index 6ab35a8f..09a45944 100644 --- a/D3D11Engine/include/assimp/Exporter.hpp +++ b/D3D11Engine/include/assimp/Exporter.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/GenericProperty.h b/D3D11Engine/include/assimp/GenericProperty.h index cac6ba96..073d5331 100644 --- a/D3D11Engine/include/assimp/GenericProperty.h +++ b/D3D11Engine/include/assimp/GenericProperty.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/GltfMaterial.h b/D3D11Engine/include/assimp/GltfMaterial.h index 85476ba0..86ca8897 100644 --- a/D3D11Engine/include/assimp/GltfMaterial.h +++ b/D3D11Engine/include/assimp/GltfMaterial.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/Hash.h b/D3D11Engine/include/assimp/Hash.h index 87f06450..cf889362 100644 --- a/D3D11Engine/include/assimp/Hash.h +++ b/D3D11Engine/include/assimp/Hash.h @@ -2,8 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team - +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -48,7 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #include +#include #include +#include // ------------------------------------------------------------------------------------------------ // Hashing function taken from @@ -64,21 +65,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) +# define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +# define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif // ------------------------------------------------------------------------------------------------ inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) { -uint32_t tmp; -int rem; + uint32_t tmp; + int rem; - if (!data) return 0; - if (!len)len = (uint32_t)::strlen(data); + if (data == NULL) return 0; + if (len == 0)len = (uint32_t)::strlen(data); rem = len & 3; len >>= 2; @@ -96,7 +97,7 @@ int rem; switch (rem) { case 3: hash += get16bits (data); hash ^= hash << 16; - hash ^= data[sizeof (uint16_t)] << 18; + hash ^= abs(data[sizeof(uint16_t)]) << 18; hash += hash >> 11; break; case 2: hash += get16bits (data); diff --git a/D3D11Engine/include/assimp/IOStream.hpp b/D3D11Engine/include/assimp/IOStream.hpp index bbf3537b..12beb0db 100644 --- a/D3D11Engine/include/assimp/IOStream.hpp +++ b/D3D11Engine/include/assimp/IOStream.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -128,15 +128,11 @@ class ASSIMP_API IOStream // ---------------------------------------------------------------------------------- AI_FORCE_INLINE -IOStream::IOStream() AI_NO_EXCEPT { - // empty -} +IOStream::IOStream() AI_NO_EXCEPT = default; // ---------------------------------------------------------------------------------- AI_FORCE_INLINE -IOStream::~IOStream() { - // empty -} +IOStream::~IOStream() = default; // ---------------------------------------------------------------------------------- } //!namespace Assimp diff --git a/D3D11Engine/include/assimp/IOStreamBuffer.h b/D3D11Engine/include/assimp/IOStreamBuffer.h index bbb5ef25..fae480e7 100644 --- a/D3D11Engine/include/assimp/IOStreamBuffer.h +++ b/D3D11Engine/include/assimp/IOStreamBuffer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -141,9 +141,7 @@ AI_FORCE_INLINE IOStreamBuffer::IOStreamBuffer(size_t cache) : } template -AI_FORCE_INLINE IOStreamBuffer::~IOStreamBuffer() { - // empty -} +AI_FORCE_INLINE IOStreamBuffer::~IOStreamBuffer() = default; template AI_FORCE_INLINE bool IOStreamBuffer::open(IOStream *stream) { @@ -325,7 +323,9 @@ AI_FORCE_INLINE bool IOStreamBuffer::getNextLine(std::vector &buffer) { } } buffer[i] = '\n'; - ++m_cachePos; + while (m_cachePos < m_cacheSize && (m_cache[m_cachePos] == '\r' || m_cache[m_cachePos] == '\n')) { + ++m_cachePos; + } return true; } diff --git a/D3D11Engine/include/assimp/IOSystem.hpp b/D3D11Engine/include/assimp/IOSystem.hpp index dda0718e..30f48b81 100644 --- a/D3D11Engine/include/assimp/IOSystem.hpp +++ b/D3D11Engine/include/assimp/IOSystem.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -237,15 +237,10 @@ class ASSIMP_API IOSystem }; // ---------------------------------------------------------------------------- -AI_FORCE_INLINE IOSystem::IOSystem() AI_NO_EXCEPT : - m_pathStack() { - // empty -} +AI_FORCE_INLINE IOSystem::IOSystem() AI_NO_EXCEPT = default; // ---------------------------------------------------------------------------- -AI_FORCE_INLINE IOSystem::~IOSystem() { - // empty -} +AI_FORCE_INLINE IOSystem::~IOSystem() = default; // ---------------------------------------------------------------------------- // For compatibility, the interface of some functions taking a std::string was @@ -288,15 +283,6 @@ AI_FORCE_INLINE bool IOSystem::PushDirectory( const std::string &path ) { return true; } -// ---------------------------------------------------------------------------- -AI_FORCE_INLINE const std::string &IOSystem::CurrentDirectory() const { - if ( m_pathStack.empty() ) { - static const std::string Dummy; - return Dummy; - } - return m_pathStack[ m_pathStack.size()-1 ]; -} - // ---------------------------------------------------------------------------- AI_FORCE_INLINE size_t IOSystem::StackSize() const { return m_pathStack.size(); diff --git a/D3D11Engine/include/assimp/Importer.hpp b/D3D11Engine/include/assimp/Importer.hpp index 6ce327c4..418643f1 100644 --- a/D3D11Engine/include/assimp/Importer.hpp +++ b/D3D11Engine/include/assimp/Importer.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team @@ -113,7 +113,7 @@ namespace Assimp { * If you need the Importer to do custom file handling to access the files, * implement IOSystem and IOStream and supply an instance of your custom * IOSystem implementation by calling SetIOHandler() before calling ReadFile(). -* If you do not assign a custion IO handler, a default handler using the +* If you do not assign a custom IO handler, a default handler using the * standard C++ IO logic will be used. * * @note One Importer instance is not thread-safe. If you use multiple diff --git a/D3D11Engine/include/assimp/LineSplitter.h b/D3D11Engine/include/assimp/LineSplitter.h index 0a9d2443..379821f0 100644 --- a/D3D11Engine/include/assimp/LineSplitter.h +++ b/D3D11Engine/include/assimp/LineSplitter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -145,7 +145,6 @@ class LineSplitter { AI_FORCE_INLINE LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_empty_lines, bool trim ) : mIdx(0), - mCur(), mStream(stream), mSwallow(), mSkip_empty_lines(skip_empty_lines), @@ -155,9 +154,7 @@ AI_FORCE_INLINE LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_emp mIdx = 0; } -AI_FORCE_INLINE LineSplitter::~LineSplitter() { - // empty -} +AI_FORCE_INLINE LineSplitter::~LineSplitter() = default; AI_FORCE_INLINE LineSplitter& LineSplitter::operator++() { if (mSwallow) { diff --git a/D3D11Engine/include/assimp/LogAux.h b/D3D11Engine/include/assimp/LogAux.h index 01a7d637..a8cb8f24 100644 --- a/D3D11Engine/include/assimp/LogAux.h +++ b/D3D11Engine/include/assimp/LogAux.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { /// @brief Logger class, which will extend the class by log-functions. -/// @tparam TDeriving +/// @tparam TDeriving template class LogFunctions { public: diff --git a/D3D11Engine/include/assimp/LogStream.hpp b/D3D11Engine/include/assimp/LogStream.hpp index 64a7955f..3b17b200 100644 --- a/D3D11Engine/include/assimp/LogStream.hpp +++ b/D3D11Engine/include/assimp/LogStream.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -99,13 +99,9 @@ class ASSIMP_API LogStream }; // !class LogStream -inline LogStream::LogStream() AI_NO_EXCEPT { - // empty -} +inline LogStream::LogStream() AI_NO_EXCEPT = default; -inline LogStream::~LogStream() { - // empty -} +inline LogStream::~LogStream() = default; } // Namespace Assimp diff --git a/D3D11Engine/include/assimp/Logger.hpp b/D3D11Engine/include/assimp/Logger.hpp index 549b0fbc..e8df64dd 100644 --- a/D3D11Engine/include/assimp/Logger.hpp +++ b/D3D11Engine/include/assimp/Logger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -263,9 +263,7 @@ inline Logger::Logger() AI_NO_EXCEPT : } // ---------------------------------------------------------------------------------- -inline Logger::~Logger() { - // empty -} +inline Logger::~Logger() = default; // ---------------------------------------------------------------------------------- inline Logger::Logger(LogSeverity severity) : diff --git a/D3D11Engine/include/assimp/MathFunctions.h b/D3D11Engine/include/assimp/MathFunctions.h index 2088c394..f2a7ccdf 100644 --- a/D3D11Engine/include/assimp/MathFunctions.h +++ b/D3D11Engine/include/assimp/MathFunctions.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/MemoryIOWrapper.h b/D3D11Engine/include/assimp/MemoryIOWrapper.h index 0e509d99..4023f752 100644 --- a/D3D11Engine/include/assimp/MemoryIOWrapper.h +++ b/D3D11Engine/include/assimp/MemoryIOWrapper.h @@ -2,8 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team - +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -66,23 +65,21 @@ namespace Assimp { // ---------------------------------------------------------------------------------- class MemoryIOStream : public IOStream { public: - MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) - : buffer (buff) - , length(len) - , pos((size_t)0) - , own(own) { + MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) : + buffer (buff), + length(len), + pos(static_cast(0)), + own(own) { // empty } - ~MemoryIOStream () { + ~MemoryIOStream() override { if(own) { delete[] buffer; } } - // ------------------------------------------------------------------- - // Read from stream - size_t Read(void* pvBuffer, size_t pSize, size_t pCount) { + size_t Read(void* pvBuffer, size_t pSize, size_t pCount) override { ai_assert(nullptr != pvBuffer); ai_assert(0 != pSize); @@ -95,16 +92,12 @@ class MemoryIOStream : public IOStream { return cnt; } - // ------------------------------------------------------------------- - // Write to stream - size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/,size_t /*pCount*/) { + size_t Write(const void*, size_t, size_t ) override { ai_assert(false); // won't be needed return 0; } - // ------------------------------------------------------------------- - // Seek specific position - aiReturn Seek(size_t pOffset, aiOrigin pOrigin) { + aiReturn Seek(size_t pOffset, aiOrigin pOrigin) override { if (aiOrigin_SET == pOrigin) { if (pOffset > length) { return AI_FAILURE; @@ -124,21 +117,15 @@ class MemoryIOStream : public IOStream { return AI_SUCCESS; } - // ------------------------------------------------------------------- - // Get current seek position - size_t Tell() const { + size_t Tell() const override { return pos; } - // ------------------------------------------------------------------- - // Get size of file - size_t FileSize() const { + size_t FileSize() const override { return length; } - // ------------------------------------------------------------------- - // Flush file contents - void Flush() { + void Flush() override{ ai_assert(false); // won't be needed } @@ -149,24 +136,19 @@ class MemoryIOStream : public IOStream { }; // --------------------------------------------------------------------------- -/** Dummy IO system to read from a memory buffer */ +/// @brief Dummy IO system to read from a memory buffer. class MemoryIOSystem : public IOSystem { public: - /** Constructor. */ - MemoryIOSystem(const uint8_t* buff, size_t len, IOSystem* io) - : buffer(buff) - , length(len) - , existing_io(io) - , created_streams() { + /// @brief Constructor. + MemoryIOSystem(const uint8_t* buff, size_t len, IOSystem* io) : buffer(buff), length(len), existing_io(io) { // empty } - /** Destructor. */ - ~MemoryIOSystem() { - } + /// @brief Destructor. + ~MemoryIOSystem() override = default; // ------------------------------------------------------------------- - /** Tests for the existence of a file at the given path. */ + /// @brief Tests for the existence of a file at the given path. bool Exists(const char* pFile) const override { if (0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { return true; @@ -175,24 +157,24 @@ class MemoryIOSystem : public IOSystem { } // ------------------------------------------------------------------- - /** Returns the directory separator. */ + /// @brief Returns the directory separator. char getOsSeparator() const override { return existing_io ? existing_io->getOsSeparator() : '/'; // why not? it doesn't care } // ------------------------------------------------------------------- - /** Open a new file with a given path. */ + /// @brief Open a new file with a given path. IOStream* Open(const char* pFile, const char* pMode = "rb") override { if ( 0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { created_streams.emplace_back(new MemoryIOStream(buffer, length)); return created_streams.back(); } - return existing_io ? existing_io->Open(pFile, pMode) : NULL; + return existing_io ? existing_io->Open(pFile, pMode) : nullptr; } // ------------------------------------------------------------------- - /** Closes the given file and releases all resources associated with it. */ + /// @brief Closes the given file and releases all resources associated with it. void Close( IOStream* pFile) override { auto it = std::find(created_streams.begin(), created_streams.end(), pFile); if (it != created_streams.end()) { @@ -204,36 +186,43 @@ class MemoryIOSystem : public IOSystem { } // ------------------------------------------------------------------- - /** Compare two paths */ + /// @brief Compare two paths bool ComparePaths(const char* one, const char* second) const override { return existing_io ? existing_io->ComparePaths(one, second) : false; } + /// @brief Will push the directory. bool PushDirectory( const std::string &path ) override { return existing_io ? existing_io->PushDirectory(path) : false; } + /// @brief Will return the current directory from the stack top. const std::string &CurrentDirectory() const override { static std::string empty; return existing_io ? existing_io->CurrentDirectory() : empty; } + /// @brief Returns the stack size. size_t StackSize() const override { return existing_io ? existing_io->StackSize() : 0; } + /// @brief Will pop the upper directory. bool PopDirectory() override { return existing_io ? existing_io->PopDirectory() : false; } + /// @brief Will create the directory. bool CreateDirectory( const std::string &path ) override { return existing_io ? existing_io->CreateDirectory(path) : false; } + /// @brief Will change the directory. bool ChangeDirectory( const std::string &path ) override { return existing_io ? existing_io->ChangeDirectory(path) : false; } + /// @brief Will delete the file. bool DeleteFile( const std::string &file ) override { return existing_io ? existing_io->DeleteFile(file) : false; } @@ -247,4 +236,4 @@ class MemoryIOSystem : public IOSystem { } // end namespace Assimp -#endif +#endif // AI_MEMORYIOSTREAM_H_INC diff --git a/D3D11Engine/include/assimp/NullLogger.hpp b/D3D11Engine/include/assimp/NullLogger.hpp index 8277b014..1b594ea2 100644 --- a/D3D11Engine/include/assimp/NullLogger.hpp +++ b/D3D11Engine/include/assimp/NullLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/ObjMaterial.h b/D3D11Engine/include/assimp/ObjMaterial.h new file mode 100644 index 00000000..9c511916 --- /dev/null +++ b/D3D11Engine/include/assimp/ObjMaterial.h @@ -0,0 +1,84 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2022, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/** @file OBJMATERIAL.h + * @brief Obj-specific material macros + * + */ + +#ifndef AI_OBJMATERIAL_H_INC +#define AI_OBJMATERIAL_H_INC + +#ifdef __GNUC__ +# pragma GCC system_header +#endif + +#include + +// --------------------------------------------------------------------------- + +// the original illum property +#define AI_MATKEY_OBJ_ILLUM "$mat.illum", 0, 0 + +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +// Pure key names for all obj texture-related properties +//! @cond MATS_DOC_FULL + +// support for bump -bm +#define _AI_MATKEY_OBJ_BUMPMULT_BASE "$tex.bumpmult" +//! @endcond + +// --------------------------------------------------------------------------- +#define AI_MATKEY_OBJ_BUMPMULT(type, N) _AI_MATKEY_OBJ_BUMPMULT_BASE, type, N + +//! @cond MATS_DOC_FULL +#define AI_MATKEY_OBJ_BUMPMULT_NORMALS(N) \ + AI_MATKEY_OBJ_BUMPMULT(aiTextureType_NORMALS, N) + +#define AI_MATKEY_OBJ_BUMPMULT_HEIGHT(N) \ + AI_MATKEY_OBJ_BUMPMULT(aiTextureType_HEIGHT, N) + +//! @endcond + + +#endif diff --git a/D3D11Engine/include/assimp/ParsingUtils.h b/D3D11Engine/include/assimp/ParsingUtils.h index b5074869..b08f2322 100644 --- a/D3D11Engine/include/assimp/ParsingUtils.h +++ b/D3D11Engine/include/assimp/ParsingUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/Profiler.h b/D3D11Engine/include/assimp/Profiler.h index 2f2c72bf..3b9263b4 100644 --- a/D3D11Engine/include/assimp/Profiler.h +++ b/D3D11Engine/include/assimp/Profiler.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -68,9 +68,7 @@ using namespace Formatter; */ class Profiler { public: - Profiler() { - // empty - } + Profiler() = default; /** Start a named timer */ diff --git a/D3D11Engine/include/assimp/ProgressHandler.hpp b/D3D11Engine/include/assimp/ProgressHandler.hpp index a4201540..93d88165 100644 --- a/D3D11Engine/include/assimp/ProgressHandler.hpp +++ b/D3D11Engine/include/assimp/ProgressHandler.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -67,14 +67,11 @@ class ASSIMP_API ProgressHandler { protected: /// @brief Default constructor - ProgressHandler () AI_NO_EXCEPT { - // empty - } + ProgressHandler () AI_NO_EXCEPT = default; public: /// @brief Virtual destructor. - virtual ~ProgressHandler () { - } + virtual ~ProgressHandler () = default; // ------------------------------------------------------------------- /** @brief Progress callback. diff --git a/D3D11Engine/include/assimp/RemoveComments.h b/D3D11Engine/include/assimp/RemoveComments.h index 32f2c672..c2defff6 100644 --- a/D3D11Engine/include/assimp/RemoveComments.h +++ b/D3D11Engine/include/assimp/RemoveComments.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/SGSpatialSort.h b/D3D11Engine/include/assimp/SGSpatialSort.h index 23a3cb53..96feefab 100644 --- a/D3D11Engine/include/assimp/SGSpatialSort.h +++ b/D3D11Engine/include/assimp/SGSpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/SceneCombiner.h b/D3D11Engine/include/assimp/SceneCombiner.h index 809ac30e..d6096900 100644 --- a/D3D11Engine/include/assimp/SceneCombiner.h +++ b/D3D11Engine/include/assimp/SceneCombiner.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -191,13 +191,9 @@ struct SceneHelper { */ class ASSIMP_API SceneCombiner { // class cannot be instanced - SceneCombiner() { - // empty - } + SceneCombiner() = delete; - ~SceneCombiner() { - // empty - } + ~SceneCombiner() = delete; public: // ------------------------------------------------------------------- @@ -361,6 +357,7 @@ class ASSIMP_API SceneCombiner { static void Copy(aiNodeAnim **dest, const aiNodeAnim *src); static void Copy(aiMeshMorphAnim **dest, const aiMeshMorphAnim *src); static void Copy(aiMetadata **dest, const aiMetadata *src); + static void Copy(aiString **dest, const aiString *src); // recursive, of course static void Copy(aiNode **dest, const aiNode *src); diff --git a/D3D11Engine/include/assimp/SkeletonMeshBuilder.h b/D3D11Engine/include/assimp/SkeletonMeshBuilder.h index 2479f430..2929aaa6 100644 --- a/D3D11Engine/include/assimp/SkeletonMeshBuilder.h +++ b/D3D11Engine/include/assimp/SkeletonMeshBuilder.h @@ -4,8 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team - +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -102,7 +101,7 @@ class ASSIMP_API SkeletonMeshBuilder { /** Creates a dummy material and returns it. */ aiMaterial *CreateMaterial(); -protected: +private: /** space to assemble the mesh data: points */ std::vector mVertices; diff --git a/D3D11Engine/include/assimp/SmallVector.h b/D3D11Engine/include/assimp/SmallVector.h index fb78f5a9..60ad2641 100644 --- a/D3D11Engine/include/assimp/SmallVector.h +++ b/D3D11Engine/include/assimp/SmallVector.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/SmoothingGroups.h b/D3D11Engine/include/assimp/SmoothingGroups.h index 75441788..4625a291 100644 --- a/D3D11Engine/include/assimp/SmoothingGroups.h +++ b/D3D11Engine/include/assimp/SmoothingGroups.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/SmoothingGroups.inl b/D3D11Engine/include/assimp/SmoothingGroups.inl index 08c2dfa5..d5fff5bf 100644 --- a/D3D11Engine/include/assimp/SmoothingGroups.inl +++ b/D3D11Engine/include/assimp/SmoothingGroups.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/SpatialSort.h b/D3D11Engine/include/assimp/SpatialSort.h index c0c4a029..cd055450 100644 --- a/D3D11Engine/include/assimp/SpatialSort.h +++ b/D3D11Engine/include/assimp/SpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -162,7 +162,7 @@ class ASSIMP_API SpatialSort { unsigned int mIndex; ///< The vertex referred by this entry aiVector3D mPosition; ///< Position /// Distance of this vertex to the sorting plane. This is set by Finalize. - ai_real mDistance; + ai_real mDistance; Entry() AI_NO_EXCEPT : mIndex(std::numeric_limits::max()), diff --git a/D3D11Engine/include/assimp/StandardShapes.h b/D3D11Engine/include/assimp/StandardShapes.h index 7084427b..77880cf9 100644 --- a/D3D11Engine/include/assimp/StandardShapes.h +++ b/D3D11Engine/include/assimp/StandardShapes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/StreamReader.h b/D3D11Engine/include/assimp/StreamReader.h index c6c17762..44b24a33 100644 --- a/D3D11Engine/include/assimp/StreamReader.h +++ b/D3D11Engine/include/assimp/StreamReader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/StreamWriter.h b/D3D11Engine/include/assimp/StreamWriter.h index f787a3fa..50e28447 100644 --- a/D3D11Engine/include/assimp/StreamWriter.h +++ b/D3D11Engine/include/assimp/StreamWriter.h @@ -3,9 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team - - +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -68,8 +66,7 @@ namespace Assimp { */ // -------------------------------------------------------------------------------------------- template -class StreamWriter -{ +class StreamWriter { enum { INITIAL_CAPACITY = 1024 }; diff --git a/D3D11Engine/include/assimp/StringComparison.h b/D3D11Engine/include/assimp/StringComparison.h index b0161664..0518d426 100644 --- a/D3D11Engine/include/assimp/StringComparison.h +++ b/D3D11Engine/include/assimp/StringComparison.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. diff --git a/D3D11Engine/include/assimp/StringUtils.h b/D3D11Engine/include/assimp/StringUtils.h index 025a826d..cd872678 100644 --- a/D3D11Engine/include/assimp/StringUtils.h +++ b/D3D11Engine/include/assimp/StringUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -56,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #define AI_SIZEFMT "%Iu" #else #define AI_SIZEFMT "%zu" diff --git a/D3D11Engine/include/assimp/Subdivision.h b/D3D11Engine/include/assimp/Subdivision.h index 095550a1..11412036 100644 --- a/D3D11Engine/include/assimp/Subdivision.h +++ b/D3D11Engine/include/assimp/Subdivision.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -122,10 +122,7 @@ class ASSIMP_API Subdivider { }; -inline -Subdivider::~Subdivider() { - // empty -} +inline Subdivider::~Subdivider() = default; } // end namespace Assimp diff --git a/D3D11Engine/include/assimp/TinyFormatter.h b/D3D11Engine/include/assimp/TinyFormatter.h index 112f1901..df2a32ec 100644 --- a/D3D11Engine/include/assimp/TinyFormatter.h +++ b/D3D11Engine/include/assimp/TinyFormatter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -119,29 +119,41 @@ class basic_formatter { * work for const references, so many function prototypes will * include const basic_formatter& s but might still want to * modify the formatted string without the need for a full copy.*/ - template - const basic_formatter& operator << (const TToken& s) const { + template ::value>::type * = nullptr> + const basic_formatter &operator<<(const TToken &s) const { underlying << s; return *this; } - template - basic_formatter& operator << (const TToken& s) { + template ::value>::type * = nullptr> + const basic_formatter &operator<<(const TToken &s) const { + underlying << s.what(); + return *this; + } + + template ::value>::type * = nullptr> + basic_formatter &operator<<(const TToken &s) { underlying << s; return *this; } + template ::value>::type * = nullptr> + basic_formatter &operator<<(const TToken &s) { + underlying << s.what(); + return *this; + } + // comma operator overloaded as well, choose your preferred way. template const basic_formatter& operator, (const TToken& s) const { - underlying << s; + *this << s; return *this; } template basic_formatter& operator, (const TToken& s) { - underlying << s; + *this << s; return *this; } @@ -149,7 +161,7 @@ class basic_formatter { // See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824 template basic_formatter& operator, (TToken& s) { - underlying << s; + *this << s; return *this; } diff --git a/D3D11Engine/include/assimp/Vertex.h b/D3D11Engine/include/assimp/Vertex.h index ad5ff476..3fc97450 100644 --- a/D3D11Engine/include/assimp/Vertex.h +++ b/D3D11Engine/include/assimp/Vertex.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2021, assimp team +Copyright (c) 2006-2022, assimp team All rights reserved. @@ -97,15 +97,21 @@ namespace Assimp { * to *all* vertex components equally. This is useful for stuff like interpolation * or subdivision, but won't work if special handling is required for some vertex components. */ // ------------------------------------------------------------------------------------------------ -class Vertex { +struct Vertex { friend Vertex operator + (const Vertex&,const Vertex&); friend Vertex operator - (const Vertex&,const Vertex&); friend Vertex operator * (const Vertex&,ai_real); friend Vertex operator / (const Vertex&,ai_real); friend Vertex operator * (ai_real, const Vertex&); -public: - Vertex() {} + aiVector3D position; + aiVector3D normal; + aiVector3D tangent, bitangent; + + aiVector3D texcoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]; + aiColor4D colors[AI_MAX_NUMBER_OF_COLOR_SETS]; + + Vertex() = default; // ---------------------------------------------------------------------------- /** Extract a particular vertex from a mesh and interleave all components */ @@ -135,7 +141,9 @@ class Vertex { /** Extract a particular vertex from a anim mesh and interleave all components */ explicit Vertex(const aiAnimMesh* msh, unsigned int idx) { ai_assert(idx < msh->mNumVertices); - position = msh->mVertices[idx]; + if (msh->HasPositions()) { + position = msh->mVertices[idx]; + } if (msh->HasNormals()) { normal = msh->mNormals[idx]; @@ -176,7 +184,7 @@ class Vertex { } // ---------------------------------------------------------------------------- - /** Convert back to non-interleaved storage */ + /// Convert back to non-interleaved storage void SortBack(aiMesh* out, unsigned int idx) const { ai_assert(idxmNumVertices); out->mVertices[idx] = position; @@ -202,7 +210,7 @@ class Vertex { private: // ---------------------------------------------------------------------------- - /** Construct from two operands and a binary operation to combine them */ + /// Construct from two operands and a binary operation to combine them template