mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
33 lines
686 B
C++
33 lines
686 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)
|
|
{
|
|
|
|
}
|
|
|
|
void ResourceManager::updateCache(double referenceTime)
|
|
{
|
|
mCache->updateTimeStampOfObjectsInCacheWithExternalReferences(referenceTime);
|
|
mCache->removeExpiredObjectsInCache(referenceTime - mExpiryDelay);
|
|
}
|
|
|
|
void ResourceManager::setExpiryDelay(double expiryDelay)
|
|
{
|
|
mExpiryDelay = expiryDelay;
|
|
}
|
|
|
|
const VFS::Manager* ResourceManager::getVFS() const
|
|
{
|
|
return mVFS;
|
|
}
|
|
|
|
}
|