Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 81 files). Show all
Unified · Split
| @@ -9,7 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | // |
| 10 | 10 | #include "RenderScriptingInterface.h" |
| 11 | 11 | |
| 12 | −#include <RenderCommonTask.h> | |
| 13 | 12 | #include <ScriptEngineCast.h> |
| 14 | 13 | |
| 15 | 14 | #include "LightingModel.h" |
| @@ -80,35 +79,14 @@ void RenderScriptingInterface::setRenderMethod(RenderMethod renderMethod) { · 64 unmodified lines | ||
| 80 | 79 | emit settingsChanged(); |
| 81 | 80 | } |
| 82 | 81 | } |
| 83 | − | |
| 84 | −void recursivelyUpdateMirrorRenderMethods(const QString& parentTaskName, int renderMethod, int depth) { | |
| 85 | − if (depth == RenderMirrorTask::MAX_MIRROR_DEPTH) { | |
| 86 | − return; | |
| 87 | − } | |
| 88 | − | |
| 89 | − for (size_t mirrorIndex = 0; mirrorIndex < RenderMirrorTask::MAX_MIRRORS_PER_LEVEL; mirrorIndex++) { | |
| 90 | − std::string mirrorTaskString = parentTaskName.toStdString() + ".RenderMirrorView" + std::to_string(mirrorIndex) + "Depth" + std::to_string(depth) + ".DeferredForwardSwitch"; | |
| 91 | − auto mirrorConfig = dynamic_cast<render::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig(QString::fromStdString(mirrorTaskString))); | |
| 92 | − if (mirrorConfig) { | |
| 93 | − mirrorConfig->setBranch((int)renderMethod); | |
| 94 | − recursivelyUpdateMirrorRenderMethods(QString::fromStdString(mirrorTaskString) + (renderMethod == 1 ? ".RenderForwardTask" : ".RenderShadowsAndDeferredTask.RenderDeferredTask"), | |
| 95 | − renderMethod, depth + 1); | |
| 96 | − } | |
| 97 | − } | |
| 98 | −} | |
| 99 | − | |
| 100 | 82 | void RenderScriptingInterface::forceRenderMethod(RenderMethod renderMethod) { |
| 101 | 83 | _renderSettingLock.withWriteLock([&] { |
| 102 | 84 | _renderMethod = (int)renderMethod; |
| 103 | 85 | _renderMethodSetting.set((int)renderMethod); |
| 104 | 86 | |
| 105 | − QString configName = "RenderMainView.DeferredForwardSwitch"; | |
| 106 | − auto config = dynamic_cast<render::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig(configName)); | |
| 87 | + auto config = dynamic_cast<render::SwitchConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); | |
| 107 | 88 | if (config) { |
| 108 | 89 | config->setBranch((int)renderMethod); |
| 109 | − | |
| 110 | − recursivelyUpdateMirrorRenderMethods(configName + (renderMethod == RenderMethod::FORWARD ? ".RenderForwardTask" : ".RenderShadowsAndDeferredTask.RenderDeferredTask"), | |
| 111 | − (int)renderMethod, 0); | |
| 112 | 90 | } |
| 113 | 91 | }); |
| 114 | 92 | } |