mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Use a different loader object for each NIF mesh
This commit is contained in:
parent
9436ca4b0c
commit
fdfe40a55a
@ -128,6 +128,8 @@ public:
|
||||
};
|
||||
|
||||
|
||||
NIFLoader::LoaderMap NIFLoader::sLoaders;
|
||||
|
||||
void NIFLoader::warn(const std::string &msg)
|
||||
{
|
||||
std::cerr << "NIFLoader: Warn:" << msg << "\n";
|
||||
@ -331,8 +333,8 @@ Ogre::MeshPtr NIFLoader::load(const std::string &name, const std::string &group)
|
||||
Ogre::MeshPtr themesh = meshMgr.getByName(name, group);
|
||||
if(themesh.isNull())
|
||||
{
|
||||
static NIFLoader loader;
|
||||
themesh = meshMgr.createManual(name, group, &loader);
|
||||
NIFLoader *loader = &sLoaders[name];
|
||||
themesh = meshMgr.createManual(name, group, loader);
|
||||
}
|
||||
return themesh;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <libs/platform/strings.h>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
// For warning messages
|
||||
#include <limits>
|
||||
using namespace boost::algorithm;
|
||||
@ -90,11 +90,11 @@ public:
|
||||
const std::string &group="General");
|
||||
|
||||
private:
|
||||
NIFLoader() {}
|
||||
NIFLoader(NIFLoader& n) {}
|
||||
|
||||
void warn(const std::string &msg);
|
||||
void fail(const std::string &msg);
|
||||
|
||||
typedef std::map<std::string,NIFLoader,ciLessBoost> LoaderMap;
|
||||
static LoaderMap sLoaders;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user