Skip to content

Commit

Permalink
Updated tinygltf to version 2.0 (master branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ybalrid committed Aug 31, 2018
1 parent 23ffcd3 commit bbe4089
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/Ogre_glTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
};

Expand Down
8 changes: 2 additions & 6 deletions src/Ogre_glTF_OgrePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "Ogre_glTF_OgrePlugin.hpp"
#include <algorithm>

Ogre_glTF::glTFLoaderPlugin* gPluginInstaller = nullptr;

Expand All @@ -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;
Expand All @@ -23,8 +22,6 @@ void Ogre_glTF_EXPORT dllStopPlugin(void)
delete gPluginInstaller;
gPluginInstaller = nullptr;
}


}

Ogre_glTF::glTFLoaderPlugin::glTFLoaderPlugin() : Ogre::Plugin() {}
Expand All @@ -40,4 +37,3 @@ void Ogre_glTF::glTFLoaderPlugin::initialise() { gltf = std::make_unique<Ogre_gl
void Ogre_glTF::glTFLoaderPlugin::shutdown() { gltf = nullptr; }

void Ogre_glTF::glTFLoaderPlugin::uninstall() {}

0 comments on commit bbe4089

Please sign in to comment.