1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-27 09:41:16 +00:00

Tweak message and temporarily set model ttl to 0

This commit is contained in:
Evil Eye 2022-11-10 17:24:58 +01:00
parent 0ae5755abb
commit b94818b24a
2 changed files with 7 additions and 3 deletions

View File

@ -1614,7 +1614,10 @@ namespace MWScript
public:
void execute(Interpreter::Runtime& runtime) override
{
runtime.getContext().report("Loading all models. This may take a while...");
Resource::SceneManager* sceneManager
= MWBase::Environment::get().getResourceSystem()->getSceneManager();
double delay = sceneManager->getExpiryDelay();
sceneManager->setExpiryDelay(0.0);
int count = 0;
test<ESM::Activator>(count);
@ -1636,8 +1639,9 @@ namespace MWScript
test<ESM::Static>(count);
test<ESM::Weapon>(count);
sceneManager->setExpiryDelay(delay);
std::stringstream message;
message << "Attempted to load " << count << " models. Check the log for details.";
message << "Attempted to load models for " << count << " objects. Check the log for details.";
runtime.getContext().report(message.str());
}
};

View File

@ -60,7 +60,7 @@ namespace Resource
/// How long to keep objects in cache after no longer being referenced.
void setExpiryDelay(double expiryDelay) override { mExpiryDelay = expiryDelay; }
float getExpiryDelay() const { return mExpiryDelay; }
double getExpiryDelay() const { return mExpiryDelay; }
const VFS::Manager* getVFS() const { return mVFS; }