Renamed lua binding, and use action to avoid concurrency issue

remove_forgotten_code
florent.teppe 2 years ago
parent f78fa989ee
commit fc8838c7dd

@ -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);

Loading…
Cancel
Save