From bbe40895f956ba45395e3715aea7d253e6ca93c2 Mon Sep 17 00:00:00 2001 From: "Arthur Brainville (Ybalrid)" Date: Fri, 31 Aug 2018 23:22:33 +0200 Subject: [PATCH] Updated tinygltf to version 2.0 (master branch) --- src/Ogre_glTF.cpp | 9 ++++++--- src/Ogre_glTF_OgrePlugin.cpp | 8 ++------ thirdParty/tinygltf | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Ogre_glTF.cpp b/src/Ogre_glTF.cpp index a8ded0d..8b671df 100644 --- a/src/Ogre_glTF.cpp +++ b/src/Ogre_glTF.cpp @@ -35,6 +35,9 @@ struct loaderAdapter::impl ///Where tinygltf will write it's error status std::string error = ""; + ///Where tinygltf will write it's warning messages + std::string warnings = ""; + ///Texture importer object : go throught the texture array and load them into Ogre textureImporter textureImp; @@ -152,16 +155,16 @@ struct glTFLoader::glTFLoaderImpl case FileType::Unknown: return false; case FileType::Ascii: //OgreLog("Detected ascii file type"); - return loader.LoadASCIIFromFile(&adapter.pimpl->model, &adapter.pimpl->error, path); + return loader.LoadASCIIFromFile(&adapter.pimpl->model, &adapter.pimpl->error, &adapter.pimpl->warnings, path); case FileType::Binary: //OgreLog("Deteted binary file type"); - return loader.LoadBinaryFromFile(&adapter.pimpl->model, &adapter.pimpl->error, path); + return loader.LoadBinaryFromFile(&adapter.pimpl->model, &adapter.pimpl->error, &adapter.pimpl->warnings, path); } } bool loadGlb(loaderAdapter& adapter, GlbFilePtr file) { - return loader.LoadBinaryFromMemory(&adapter.pimpl->model, &adapter.pimpl->error, file->getData(), int(file->getSize()), ".", 0); + return loader.LoadBinaryFromMemory(&adapter.pimpl->model, &adapter.pimpl->error, &adapter.pimpl->warnings, file->getData(), int(file->getSize()), ".", 0); } }; diff --git a/src/Ogre_glTF_OgrePlugin.cpp b/src/Ogre_glTF_OgrePlugin.cpp index f10701f..826d06c 100644 --- a/src/Ogre_glTF_OgrePlugin.cpp +++ b/src/Ogre_glTF_OgrePlugin.cpp @@ -1,5 +1,4 @@ #include "Ogre_glTF_OgrePlugin.hpp" -#include Ogre_glTF::glTFLoaderPlugin* gPluginInstaller = nullptr; @@ -9,8 +8,8 @@ void Ogre_glTF_EXPORT dllStartPlugin(void) { if(gPluginInstaller) { - throw std::runtime_error("Apparenltly called dllStartPlugin on the Ogre_glTF" - "plugin twice. I'm affraid you can't do that... "); + throw std::runtime_error("Apparently called dllStartPlugin on the Ogre_glTF" + "plugin twice. I'm afraid you can't do that... "); } gPluginInstaller = new Ogre_glTF::glTFLoaderPlugin; @@ -23,8 +22,6 @@ void Ogre_glTF_EXPORT dllStopPlugin(void) delete gPluginInstaller; gPluginInstaller = nullptr; } - - } Ogre_glTF::glTFLoaderPlugin::glTFLoaderPlugin() : Ogre::Plugin() {} @@ -40,4 +37,3 @@ void Ogre_glTF::glTFLoaderPlugin::initialise() { gltf = std::make_unique