From e6a47d93c2f630688d49eec82bb7226e236d2399 Mon Sep 17 00:00:00 2001 From: Krishty Date: Sat, 24 Apr 2021 13:29:15 +0200 Subject: [PATCH 1/3] removed dead code from 0d29203e24a8bc2c75278931a6bd25b2ae5848de --- code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp | 1 + code/Common/BaseImporter.cpp | 14 -------- include/assimp/BaseImporter.h | 37 +-------------------- 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp b/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp index 4df0d0d1d..eee9ed346 100644 --- a/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp +++ b/code/AssetLib/MDL/HalfLife/HL1MDLLoader.cpp @@ -57,6 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #ifdef MDL_HALFLIFE_LOG_WARN_HEADER #undef MDL_HALFLIFE_LOG_WARN_HEADER diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp index 0657216cf..6e65692f0 100644 --- a/code/Common/BaseImporter.cpp +++ b/code/Common/BaseImporter.cpp @@ -65,20 +65,6 @@ using namespace Assimp; // Constructor to be privately used by Importer BaseImporter::BaseImporter() AI_NO_EXCEPT : m_progress() { - /** - * Assimp Importer - * unit conversions available - * if you need another measurment unit add it below. - * it's currently defined in assimp that we prefer meters. - * - * NOTE: Initialised here rather than in the header file - * to workaround a VS2013 bug with brace initialisers - * */ - importerUnits[ImporterUnits::M] = 1.0; - importerUnits[ImporterUnits::CM] = 0.01; - importerUnits[ImporterUnits::MM] = 0.001; - importerUnits[ImporterUnits::INCHES] = 0.0254; - importerUnits[ImporterUnits::FEET] = 0.3048; } // ------------------------------------------------------------------------------------------------ diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index 86d7ba70f..80c79b9a2 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -51,10 +51,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Exceptional.h" -#include #include #include -#include #include #include #include @@ -179,42 +177,10 @@ public: /** * Will be called only by scale process when scaling is requested. */ - virtual void SetFileScale(double scale) { + void SetFileScale(double scale) { fileScale = scale; } - virtual double GetFileScale() const { - return fileScale; - } - - enum ImporterUnits { - M, - MM, - CM, - INCHES, - FEET - }; - - /** - * Assimp Importer - * unit conversions available - * NOTE: Valid options are initialised in the - * constructor in the implementation file to - * work around a VS2013 compiler bug if support - * for that compiler is dropped in the future - * initialisation can be moved back here - * */ - std::map importerUnits; - - virtual void SetApplicationUnits(const ImporterUnits &unit) { - importerScale = importerUnits[unit]; - applicationUnits = unit; - } - - virtual const ImporterUnits &GetApplicationUnits() { - return applicationUnits; - } - // ------------------------------------------------------------------- /** Called by #Importer::GetExtensionList for each loaded importer. * Take the extension list contained in the structure returned by @@ -223,7 +189,6 @@ public: void GetExtensionList(std::set &extensions); protected: - ImporterUnits applicationUnits = ImporterUnits::M; double importerScale = 1.0; double fileScale = 1.0; From 5c64a4dc1eb09aea9bcfc0be93136ab753a9eea1 Mon Sep 17 00:00:00 2001 From: Krishty Date: Sat, 24 Apr 2021 18:33:57 +0200 Subject: [PATCH 2/3] devirtualized a function that is called once and never overridden --- include/assimp/BaseImporter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index 80c79b9a2..38bec1afd 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -385,7 +385,7 @@ public: // static utilities private: /* Pushes state into importer for the importer scale */ - virtual void UpdateImporterScale(Importer *pImp); + void UpdateImporterScale(Importer *pImp); protected: /// Error description in case there was one. From 55056d11fd201484d141e4c80f1141c9cb1ac47c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 6 May 2021 11:50:08 +0200 Subject: [PATCH 3/3] Add missing include --- include/assimp/XmlParser.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/assimp/XmlParser.h b/include/assimp/XmlParser.h index f525d3549..91fb9907f 100644 --- a/include/assimp/XmlParser.h +++ b/include/assimp/XmlParser.h @@ -43,8 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_IRRXML_WRAPPER #include +#include + #include "BaseImporter.h" #include "IOStream.hpp" + #include #include