forked from teamnwah/openmw-tes3coop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
932 B
C++
47 lines
932 B
C++
#include "resourcemanager.hpp"
|
|
|
|
#include "objectcache.hpp"
|
|
|
|
namespace Resource
|
|
{
|
|
|
|
ResourceManager::ResourceManager(const VFS::Manager *vfs)
|
|
: mVFS(vfs)
|
|
, mCache(new Resource::ObjectCache)
|
|
, mExpiryDelay(0.0)
|
|
{
|
|
|
|
}
|
|
|
|
ResourceManager::~ResourceManager()
|
|
{
|
|
}
|
|
|
|
void ResourceManager::updateCache(double referenceTime)
|
|
{
|
|
mCache->updateTimeStampOfObjectsInCacheWithExternalReferences(referenceTime);
|
|
mCache->removeExpiredObjectsInCache(referenceTime - mExpiryDelay);
|
|
}
|
|
|
|
void ResourceManager::clearCache()
|
|
{
|
|
mCache->clear();
|
|
}
|
|
|
|
void ResourceManager::setExpiryDelay(double expiryDelay)
|
|
{
|
|
mExpiryDelay = expiryDelay;
|
|
}
|
|
|
|
const VFS::Manager* ResourceManager::getVFS() const
|
|
{
|
|
return mVFS;
|
|
}
|
|
|
|
void ResourceManager::releaseGLObjects(osg::State *state)
|
|
{
|
|
mCache->releaseGLObjects(state);
|
|
}
|
|
|
|
}
|