From 813f1714935f71696e8d6d8d1b398192c3c44c33 Mon Sep 17 00:00:00 2001 From: Natanael Rabello Date: Mon, 16 Nov 2020 21:39:59 -0300 Subject: [PATCH 1/4] Update Android port README.md with ABI doc --- port/AndroidJNI/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/port/AndroidJNI/README.md b/port/AndroidJNI/README.md index 0b95efd04..336ed8782 100644 --- a/port/AndroidJNI/README.md +++ b/port/AndroidJNI/README.md @@ -14,6 +14,10 @@ To use this module please provide following cmake defines: "SOME_PATH" is a path to your cmake android toolchain script. + +The build script for this port is based on [android-cmake](https://github.com/taka-no-me/android-cmake). +See its documentation for more Android-specific cmake options (e.g. -DANDROID_ABI for the target ABI). + ### Code ### A small example how to wrap assimp for Android: ```cpp From 14f79caf4157bf6b66ffc98288a4b0ef059b56bf Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 26 Nov 2020 16:29:37 +0000 Subject: [PATCH 2/4] textures_converted keys can just be pointers --- code/AssetLib/FBX/FBXConverter.cpp | 10 +++++----- code/AssetLib/FBX/FBXConverter.h | 2 +- code/AssetLib/FBX/FBXDocument.h | 30 ------------------------------ 3 files changed, 6 insertions(+), 36 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index a7f9e6832..efecf450f 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -1715,14 +1715,14 @@ aiString FBXConverter::GetTexturePath(const Texture *tex) { bool textureReady = false; //tells if our texture is ready (if it was loaded or if it was found) unsigned int index=0; - VideoMap::const_iterator it = textures_converted.find(*media); + VideoMap::const_iterator it = textures_converted.find(media); if (it != textures_converted.end()) { index = (*it).second; textureReady = true; } else { if (media->ContentLength() > 0) { index = ConvertVideo(*media); - textures_converted[*media] = index; + textures_converted[media] = index; textureReady = true; } } @@ -2221,12 +2221,12 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial *out_mat, const PropertyTa if (media != nullptr && media->ContentLength() > 0) { unsigned int index; - VideoMap::const_iterator videoIt = textures_converted.find(*media); + VideoMap::const_iterator videoIt = textures_converted.find(media); if (videoIt != textures_converted.end()) { index = videoIt->second; } else { index = ConvertVideo(*media); - textures_converted[*media] = index; + textures_converted[media] = index; } // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture) @@ -3493,7 +3493,7 @@ void FBXConverter::ConvertOrphanedEmbeddedTextures() { if (realTexture) { const Video *media = realTexture->Media(); unsigned int index = ConvertVideo(*media); - textures_converted[*media] = index; + textures_converted[media] = index; } } } diff --git a/code/AssetLib/FBX/FBXConverter.h b/code/AssetLib/FBX/FBXConverter.h index 7db4b795b..0ae0da662 100644 --- a/code/AssetLib/FBX/FBXConverter.h +++ b/code/AssetLib/FBX/FBXConverter.h @@ -428,7 +428,7 @@ private: using MaterialMap = std::fbx_unordered_map; MaterialMap materials_converted; - using VideoMap = std::fbx_unordered_map; + using VideoMap = std::fbx_unordered_map; VideoMap textures_converted; using MeshMap = std::fbx_unordered_map >; diff --git a/code/AssetLib/FBX/FBXDocument.h b/code/AssetLib/FBX/FBXDocument.h index 165bb900e..67b953549 100644 --- a/code/AssetLib/FBX/FBXDocument.h +++ b/code/AssetLib/FBX/FBXDocument.h @@ -638,15 +638,6 @@ public: return ptr; } - bool operator==(const Video& other) const - { - return ( - type == other.type - && relativeFileName == other.relativeFileName - && fileName == other.fileName - ); - } - bool operator<(const Video& other) const { return std::tie(type, relativeFileName, fileName) < std::tie(other.type, other.relativeFileName, other.fileName); @@ -1192,25 +1183,4 @@ private: } // Namespace FBX } // Namespace Assimp -namespace std -{ - template <> - struct hash - { - std::size_t operator()(const Assimp::FBX::Video& video) const - { - using std::size_t; - using std::hash; - using std::string; - - size_t res = 17; - res = res * 31 + hash()(video.Name()); - res = res * 31 + hash()(video.RelativeFilename()); - res = res * 31 + hash()(video.Type()); - - return res; - } - }; -} - #endif // INCLUDED_AI_FBX_DOCUMENT_H From 149b8d1fd14df41962598956cc80d1d3929fdbd6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 27 Nov 2020 14:26:51 +0000 Subject: [PATCH 3/4] Don't need operator< either. --- code/AssetLib/FBX/FBXDocument.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/AssetLib/FBX/FBXDocument.h b/code/AssetLib/FBX/FBXDocument.h index 67b953549..85ccca5d0 100644 --- a/code/AssetLib/FBX/FBXDocument.h +++ b/code/AssetLib/FBX/FBXDocument.h @@ -638,11 +638,6 @@ public: return ptr; } - bool operator<(const Video& other) const - { - return std::tie(type, relativeFileName, fileName) < std::tie(other.type, other.relativeFileName, other.fileName); - } - private: std::string type; std::string relativeFileName; From 75204dfe7f8cdd86e0f53f8811446d961ceb7fe5 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 1 Dec 2020 08:58:45 +0100 Subject: [PATCH 4/4] Update README.md --- port/AndroidJNI/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/port/AndroidJNI/README.md b/port/AndroidJNI/README.md index 336ed8782..003b1da1a 100644 --- a/port/AndroidJNI/README.md +++ b/port/AndroidJNI/README.md @@ -17,6 +17,7 @@ To use this module please provide following cmake defines: The build script for this port is based on [android-cmake](https://github.com/taka-no-me/android-cmake). See its documentation for more Android-specific cmake options (e.g. -DANDROID_ABI for the target ABI). +Check [Asset-Importer-Docs](https://assimp-docs.readthedocs.io/en/latest/) for more information. ### Code ### A small example how to wrap assimp for Android: