Skip to content

Commit

Permalink
remove the deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
Ybalrid committed Nov 2, 2018
1 parent c976903 commit 43995c8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 93 deletions.
38 changes: 0 additions & 38 deletions include/Ogre_glTF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down
47 changes: 0 additions & 47 deletions src/Ogre_glTF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions src/Ogre_glTF_textureImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"); }
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}();
Expand Down

0 comments on commit 43995c8

Please sign in to comment.