1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 00:32:49 +00:00

Renamed lua binding, and use action to avoid concurrency issue

This commit is contained in:
florent.teppe 2022-08-03 23:05:35 +02:00
parent f78fa989ee
commit fc8838c7dd

View File

@ -52,12 +52,18 @@ namespace MWLua
api["triggerShaderReload"] = [context]()
{
MWBase::Environment::get().getWorld()->getRenderingManager()->getResourceSystem()->getSceneManager()->getShaderManager().triggerShaderReload();
context.mLuaManager->addAction([]
{
MWBase::Environment::get().getWorld()->getRenderingManager()->getResourceSystem()->getSceneManager()->getShaderManager().triggerShaderReload();
});
};
api["togggleShaderHotReload"] = [context](bool value)
api["setShaderHotReloadEnabled"] = [context](bool value)
{
MWBase::Environment::get().getWorld()->getRenderingManager()->getResourceSystem()->getSceneManager()->getShaderManager().setHotReloadEnabled(value);
context.mLuaManager->addAction([value]
{
MWBase::Environment::get().getWorld()->getRenderingManager()->getResourceSystem()->getSceneManager()->getShaderManager().setHotReloadEnabled(value);
});
};
return LuaUtil::makeReadOnly(api);