From 43995c89760233b70e4c2286dba4aadfdaa60784 Mon Sep 17 00:00:00 2001 From: "Arthur Brainville (Ybalrid)" Date: Fri, 2 Nov 2018 18:28:07 +0100 Subject: [PATCH] remove the deprecated API --- include/Ogre_glTF.hpp | 38 ------------------------- src/Ogre_glTF.cpp | 47 ------------------------------- src/Ogre_glTF_textureImporter.cpp | 9 +----- 3 files changed, 1 insertion(+), 93 deletions(-) diff --git a/include/Ogre_glTF.hpp b/include/Ogre_glTF.hpp index 6a1cfbb..25c6e6f 100644 --- a/include/Ogre_glTF.hpp +++ b/include/Ogre_glTF.hpp @@ -45,18 +45,6 @@ namespace Ogre_glTF } transform; }; - ///struct that contains a mesh and the datablock that should be used with it. - ///This represent what an extracted object from a glTF asset contains. - ///The mash should have a skeletonInstance attached to it the glTF file defined a skin; - struct [[deprecated]] MeshAndDataBlock - { - ///Pointer to the Ogre Mesh - Ogre::MeshPtr Mesh; - - ///Pointer to the HlmsDatablock. This should be a HlmsPbsDatablock - Ogre::HlmsDatablock* datablock; - }; - ///Plugin accessible interface that plugin users can use struct glTFLoaderInterface { @@ -71,27 +59,6 @@ namespace Ogre_glTF ///\param loadLocation flag that signal if the model is loaded directly from the filesystem, or from Ogre's resource manager virtual ModelInformation getModelData(const std::string& modelName, LoadFrom loadLocation) = 0; - ///Get you an item from a GLB file loaded inside an Ogre resource group - /// \param name The name of the resource - /// \param smgr The scene manager where the Item will be used - /// \return pointer to a created item in your scene manager using the mesh in the glTF asset - [[deprecated]] virtual Ogre::Item* getItemFromResource(const std::string& name, Ogre::SceneManager* smgr) = 0; - - ///Get you an item from a GLB or a GLTF file from the filesystem. - /// \param fileName The name of the resource - /// \param smgr The scene manager where the Item will be used - /// \return pointer to a created item in your scene manager using the mesh in the glTF asset - [[deprecated]] virtual Ogre::Item* getItemFromFileSystem(const std::string& fileName, Ogre::SceneManager* smgr) = 0; - - ///Get you a mesh and a material datablock from a GLB in the resource manager - /// \param name The name of the resource - /// \return a struct containing pointers to a mesh and a datablock - [[deprecated]] virtual MeshAndDataBlock getMeshFromResource(const std::string& name) = 0; - - ///Gets you a mesh and a material datablock from GLB or a GLTF file from the filesystem - /// \param name The name of the resource - /// \return a struct containing pointers to a mesh and a datablock - [[deprecated]] virtual MeshAndDataBlock getMeshFromFileSystem(const std::string& name) = 0; }; ///Class that hold the loaded content of a glTF file and that can create Ogre objects from it @@ -184,11 +151,6 @@ namespace Ogre_glTF ///Get the model data. Contains everything you need to create object from the model contained on the glTF asset ModelInformation getModelData(const std::string& modelName, LoadFrom loadLocation) override; - [[deprecated]] Ogre::Item* getItemFromResource(const std::string& name, Ogre::SceneManager* smgr) override; - [[deprecated]] Ogre::Item* getItemFromFileSystem(const std::string& fileName, Ogre::SceneManager* smgr) override; - [[deprecated]] MeshAndDataBlock getMeshFromResource(const std::string& name) override; - [[deprecated]] MeshAndDataBlock getMeshFromFileSystem(const std::string& name) override; - ///Deleted copy constructor glTFLoader(const glTFLoader&) = delete; diff --git a/src/Ogre_glTF.cpp b/src/Ogre_glTF.cpp index 3057f75..33ad591 100644 --- a/src/Ogre_glTF.cpp +++ b/src/Ogre_glTF.cpp @@ -234,53 +234,6 @@ ModelInformation glTFLoader::getModelData(const std::string& modelName, LoadFrom return model; } -[[deprecated]] Ogre::Item* glTFLoader::getItemFromResource(const std::string& name, Ogre::SceneManager* smgr) -{ - OgreLog("Getting resource"); - auto adapter = loadGlbResource(name); - if(adapter.isOk()) { OgreLog("Adapter is ok!"); } - else - { - OgreLog("Adapter is not okay!"); - } - - OgreLog("Calling get item with your smgr..."); - return adapter.getItem(smgr); -} - -[[deprecated]] Ogre::Item* glTFLoader::getItemFromFileSystem(const std::string& fileName, Ogre::SceneManager* smgr) -{ - auto adapter = loadFromFileSystem(fileName); - if(adapter.isOk()) { OgreLog("Adapter is ok!"); } - else - { - OgreLog("Adapter is not okay!"); - } - return adapter.getItem(smgr); -} - -[[deprecated]] MeshAndDataBlock glTFLoader::getMeshFromFileSystem(const std::string& name) -{ - auto adapter = loadFromFileSystem(name); - if(adapter.isOk()) { OgreLog("Adapter is ok!"); } - else - { - OgreLog("Adapter is not okay!"); - } - return { adapter.getMesh(), adapter.getDatablock(0) }; -} - -[[deprecated]] MeshAndDataBlock glTFLoader::getMeshFromResource(const std::string& name) -{ - auto adapter = loadGlbResource(name); - if(adapter.isOk()) { OgreLog("Adapter is ok!"); } - else - { - OgreLog("Adapter is not okay!"); - } - return { adapter.getMesh(), adapter.getDatablock(0) }; -} - glTFLoader::glTFLoader(glTFLoader&& other) noexcept : loaderImpl(std::move(other.loaderImpl)) {} glTFLoader& glTFLoader::operator=(glTFLoader&& other) noexcept diff --git a/src/Ogre_glTF_textureImporter.cpp b/src/Ogre_glTF_textureImporter.cpp index f46fd90..20c2fc5 100644 --- a/src/Ogre_glTF_textureImporter.cpp +++ b/src/Ogre_glTF_textureImporter.cpp @@ -39,9 +39,6 @@ void textureImporter::loadTexture(const tinygltf::Texture& texture) if(image.component == 4) return Ogre::PF_BYTE_RGBA; throw InitError("Can get " + name + "pixel format"); - //TODO do this properly. Right now it is guesswork - - OgreLog("unrecognized pixel format from tinygltf image"); }(); if(image.image.size() / image.component == image.width * image.height) { OgreLog("It looks like the image.component field and the image size does match"); } @@ -158,10 +155,8 @@ Ogre::TexturePtr textureImporter::generateGreyScaleFromChannel(int gltfTextureSo if(image.component == 3) return Ogre::PF_BYTE_RGB; if(image.component == 4) return Ogre::PF_BYTE_RGBA; - throw InitError("Can get " + name + "pixel format"); - //TODO do this properly. Right now it is guesswork - OgreLog("unrecognized pixel format from tinygltf image"); + throw InitError("Can get " + name + "pixel format"); }(); Ogre::Image OgreImage; @@ -210,8 +205,6 @@ Ogre::TexturePtr textureImporter::getNormalSNORM(int gltfTextureSourceID) if(image.component == 3) return Ogre::PF_BYTE_RGB; if(image.component == 4) return Ogre::PF_BYTE_RGBA; - //TODO do this properly. Right now it is guesswork - OgreLog("unrecognized pixel format from tinygltf image"); throw InitError("Can get " + name + "pixel format"); }();