Imported Upstream version 0.26.0

This commit is contained in:
Bret Curtis 2013-10-17 16:37:22 +02:00
commit 9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions

View file

@ -0,0 +1,55 @@
#ifndef COMPONENTS_NIFOGRE_MESH_HPP
#define COMPONENTS_NIFOGRE_MESH_HPP
#include <iostream>
#include <string>
#include <map>
#include <cassert>
#include <OgreResource.h>
namespace Nif
{
class NiTriShape;
}
namespace NifOgre
{
/** Manual resource loader for NiTriShapes. This is the main class responsible
* for translating the internal NIF meshes into something Ogre can use.
*/
class NIFMeshLoader : Ogre::ManualResourceLoader
{
static void warn(const std::string &msg)
{
std::cerr << "NIFMeshLoader: Warn: " << msg << std::endl;
}
static void fail(const std::string &msg)
{
std::cerr << "NIFMeshLoader: Fail: "<< msg << std::endl;
abort();
}
std::string mName;
std::string mGroup;
size_t mShapeIndex;
// Convert NiTriShape to Ogre::SubMesh
void createSubMesh(Ogre::Mesh *mesh, const Nif::NiTriShape *shape);
typedef std::map<std::string,NIFMeshLoader> LoaderMap;
static LoaderMap sLoaders;
NIFMeshLoader(const std::string &name, const std::string &group, size_t idx);
virtual void loadResource(Ogre::Resource *resource);
public:
static void createMesh(const std::string &name, const std::string &fullname, const std::string &group, size_t idx);
};
}
#endif