forked from teamnwah/openmw-tes3coop
Dead code removal
This commit is contained in:
parent
a3417a9c49
commit
372a54bbc7
7 changed files with 1 additions and 99 deletions
|
@ -7,7 +7,6 @@
|
|||
#include <components/files/collections.hpp>
|
||||
#include <components/translation/translation.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/nifcache/nifcache.hpp>
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
|
||||
|
|
|
@ -50,10 +50,6 @@ add_component_dir (nifosg
|
|||
nifloader controller particle userdata
|
||||
)
|
||||
|
||||
#add_component_dir (nifcache
|
||||
# nifcache
|
||||
# )
|
||||
|
||||
#add_component_dir (nifbullet
|
||||
# bulletnifloader
|
||||
# )
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
/// Get the name of the file
|
||||
std::string getFilename(){ return filename; }
|
||||
};
|
||||
typedef boost::shared_ptr<Nif::NIFFile> NIFFilePtr;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
#include "nifcache.hpp"
|
||||
|
||||
namespace Nif
|
||||
{
|
||||
|
||||
Cache* Cache::sThis = 0;
|
||||
|
||||
Cache& Cache::getInstance()
|
||||
{
|
||||
assert (sThis);
|
||||
return *sThis;
|
||||
}
|
||||
|
||||
Cache* Cache::getInstancePtr()
|
||||
{
|
||||
return sThis;
|
||||
}
|
||||
|
||||
Cache::Cache()
|
||||
{
|
||||
assert (!sThis);
|
||||
sThis = this;
|
||||
}
|
||||
|
||||
NIFFilePtr Cache::load(const std::string &filename)
|
||||
{
|
||||
// TODO: normalize file path to make sure we're not loading the same file twice
|
||||
|
||||
LoadedMap::iterator it = mLoadedMap.find(filename);
|
||||
if (it != mLoadedMap.end())
|
||||
return it->second;
|
||||
else
|
||||
{
|
||||
NIFFilePtr file(new Nif::NIFFile(filename));
|
||||
mLoadedMap[filename] = file;
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
#ifndef OPENMW_COMPONENTS_NIFCACHE_H
|
||||
#define OPENMW_COMPONENTS_NIFCACHE_H
|
||||
|
||||
#include <components/nif/niffile.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace Nif
|
||||
{
|
||||
|
||||
typedef boost::shared_ptr<Nif::NIFFile> NIFFilePtr;
|
||||
|
||||
/// @brief A basic resource manager for NIF files
|
||||
class Cache
|
||||
{
|
||||
public:
|
||||
Cache();
|
||||
|
||||
/// Queue this file for background loading. A worker thread will start loading the file.
|
||||
/// To get the loaded NIFFilePtr, use the load method, which will wait until the worker thread is finished
|
||||
/// and then return the loaded file.
|
||||
//void loadInBackground (const std::string& file);
|
||||
|
||||
/// Read and parse the given file. May retrieve from cache if this file has been used previously.
|
||||
/// @note If the file is currently loading in the background, this function will block until
|
||||
/// the background loading finishes, then return the background loaded file.
|
||||
/// @note Returns a SharedPtr to the file and the file will stay loaded as long as the user holds on to this pointer.
|
||||
/// When all external SharedPtrs to a file are released, the cache may decide to unload the file.
|
||||
NIFFilePtr load (const std::string& filename);
|
||||
|
||||
/// Return instance of this class.
|
||||
static Cache& getInstance();
|
||||
static Cache* getInstancePtr();
|
||||
|
||||
private:
|
||||
static Cache* sThis;
|
||||
|
||||
Cache(const Cache&);
|
||||
Cache& operator =(const Cache&);
|
||||
|
||||
typedef std::map<std::string, NIFFilePtr> LoadedMap;
|
||||
|
||||
LoadedMap mLoadedMap;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -6,8 +6,6 @@
|
|||
#include <components/nif/controller.hpp>
|
||||
#include <components/nif/data.hpp>
|
||||
|
||||
#include <components/nifcache/nifcache.hpp>
|
||||
|
||||
#include <components/sceneutil/controller.hpp>
|
||||
#include <components/sceneutil/statesetupdater.hpp>
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
|
||||
#include <components/nif/niffile.hpp>
|
||||
|
||||
#include <components/nifcache/nifcache.hpp> // NIFFilePtr
|
||||
|
||||
#include <osg/ref_ptr>
|
||||
#include <osg/Referenced>
|
||||
|
||||
|
|
Loading…
Reference in a new issue