Merge branch 'master' into master

pull/3894/head
Carsten Rudolph 2021-05-17 07:56:41 +02:00 committed by GitHub
commit 43e1e4d3d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 28 deletions

View File

@ -66,9 +66,9 @@ Open Asset Import Library is implemented in C++. The directory structure looks l
The source code is organized in the following way: The source code is organized in the following way:
code/Common The base implementation for importers and the infrastructure code/Common The base implementation for importers and the infrastructure
code/PostProcessing The post-processing steps code/PostProcessing The post-processing steps
code/<FormatName> Implementation for import and export for the format code/AssetLib/<FormatName> Implementation for import and export for the format
### Where to get help ### ### Where to get help ###
For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format. For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format.

View File

@ -200,7 +200,7 @@ void DNAParser::Parse() {
ASSIMP_LOG_DEBUG_F("BlenderDNA: Got ", dna.structures.size(), " structures with totally ", fields, " fields"); ASSIMP_LOG_DEBUG_F("BlenderDNA: Got ", dna.structures.size(), " structures with totally ", fields, " fields");
#ifdef ASSIMP_BUILD_BLENDER_DEBUG #if ASSIMP_BUILD_BLENDER_DEBUG_DNA
dna.DumpToFile(); dna.DumpToFile();
#endif #endif
@ -208,7 +208,7 @@ void DNAParser::Parse() {
dna.RegisterConverters(); dna.RegisterConverters();
} }
#ifdef ASSIMP_BUILD_BLENDER_DEBUG #if ASSIMP_BUILD_BLENDER_DEBUG_DNA
#include <fstream> #include <fstream>
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -237,7 +237,7 @@ void DNA ::DumpToFile() {
ASSIMP_LOG_INFO("BlenderDNA: Dumped dna to dna.txt"); ASSIMP_LOG_INFO("BlenderDNA: Dumped dna to dna.txt");
} }
#endif #endif // ASSIMP_BUILD_BLENDER_DEBUG_DNA
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
/*static*/ void DNA ::ExtractArraySize( /*static*/ void DNA ::ExtractArraySize(

View File

@ -59,6 +59,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ASSIMP_BUILD_BLENDER_DEBUG #define ASSIMP_BUILD_BLENDER_DEBUG
#endif #endif
// set this to non-zero to dump BlenderDNA stuff to dna.txt.
// you could set it on the assimp build command line too without touching it here.
// !!! please make sure this is set to 0 in the repo !!!
#ifndef ASSIMP_BUILD_BLENDER_DEBUG_DNA
#define ASSIMP_BUILD_BLENDER_DEBUG_DNA 0
#endif
// #define ASSIMP_BUILD_BLENDER_NO_STATS // #define ASSIMP_BUILD_BLENDER_NO_STATS
namespace Assimp { namespace Assimp {
@ -495,7 +502,7 @@ public:
const Structure &structure, const Structure &structure,
const FileDatabase &db) const; const FileDatabase &db) const;
#ifdef ASSIMP_BUILD_BLENDER_DEBUG #if ASSIMP_BUILD_BLENDER_DEBUG_DNA
// -------------------------------------------------------- // --------------------------------------------------------
/** Dump the DNA to a text file. This is for debugging purposes. /** Dump the DNA to a text file. This is for debugging purposes.
* The output file is `dna.txt` in the current working folder*/ * The output file is `dna.txt` in the current working folder*/

View File

@ -75,13 +75,12 @@ protected:
uint32_t offset; uint32_t offset;
// We define the struct size because sizeof(Header) might return a wrong result because of structure padding. // We define the struct size because sizeof(Header) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). static constexpr std::size_t header_size =
static const std::size_t header_size = sizeof(type) +
sizeof(uint16_t) + // type sizeof(size) +
sizeof(uint32_t) + // size sizeof(reserved1) +
sizeof(uint16_t) + // reserved1 sizeof(reserved2) +
sizeof(uint16_t) + // reserved2 sizeof(offset);
sizeof(uint32_t); // offset
}; };
struct DIB { struct DIB {
@ -98,22 +97,21 @@ protected:
uint32_t nb_important_colors; uint32_t nb_important_colors;
// We define the struct size because sizeof(DIB) might return a wrong result because of structure padding. // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding.
// Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). static constexpr std::size_t dib_size =
static const std::size_t dib_size = sizeof(size) +
sizeof(uint32_t) + // size sizeof(width) +
sizeof(int32_t) + // width sizeof(height) +
sizeof(int32_t) + // height sizeof(planes) +
sizeof(uint16_t) + // planes sizeof(bits_per_pixel) +
sizeof(uint16_t) + // bits_per_pixel sizeof(compression) +
sizeof(uint32_t) + // compression sizeof(image_size) +
sizeof(uint32_t) + // image_size sizeof(x_resolution) +
sizeof(int32_t) + // x_resolution sizeof(y_resolution) +
sizeof(int32_t) + // y_resolution sizeof(nb_colors) +
sizeof(uint32_t) + // nb_colors sizeof(nb_important_colors);
sizeof(uint32_t); // nb_important_colors
}; };
static const std::size_t mBytesPerPixel = 4; static constexpr std::size_t mBytesPerPixel = 4;
public: public:
static void Save(aiTexture* texture, IOStream* file); static void Save(aiTexture* texture, IOStream* file);

View File

@ -27,6 +27,7 @@ if os.name=='posix':
additional_dirs.append('./') additional_dirs.append('./')
additional_dirs.append('/usr/lib/') additional_dirs.append('/usr/lib/')
additional_dirs.append('/usr/lib/x86_64-linux-gnu/') additional_dirs.append('/usr/lib/x86_64-linux-gnu/')
additional_dirs.append('/usr/lib/aarch64-linux-gnu/')
additional_dirs.append('/usr/local/lib/') additional_dirs.append('/usr/local/lib/')
if 'LD_LIBRARY_PATH' in os.environ: if 'LD_LIBRARY_PATH' in os.environ: