Showing the changes to interface/src/Menu.cpp (1 of 55 files). Show all
Unified · Split
| @@ -49,17 +49,13 @@ · 48 unmodified lines | ||
| 49 | 49 | #include "DeferredLightingEffect.h" |
| 50 | 50 | #include "PickManager.h" |
| 51 | 51 | |
| 52 | −#include "LightingModel.h" | |
| 53 | −#include "AmbientOcclusionEffect.h" | |
| 54 | −#include "RenderShadowTask.h" | |
| 55 | −#include "AntialiasingEffect.h" | |
| 56 | − | |
| 57 | 52 | #include "scripting/SettingsScriptingInterface.h" |
| 58 | 53 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| 59 | 54 | #include "SpeechRecognizer.h" |
| 60 | 55 | #endif |
| 61 | 56 | |
| 62 | 57 | #include "MeshPartPayload.h" |
| 58 | +#include "scripting/RenderScriptingInterface.h" | |
| 63 | 59 | |
| 64 | 60 | extern bool DEV_DECIMATE_TEXTURES; |
| 65 | 61 | |
| @@ -369,45 +365,14 @@ Menu::Menu() { · 303 unmodified lines | ||
| 369 | 365 | // Developer > Render >>> |
| 370 | 366 | MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render"); |
| 371 | 367 | |
| 372 | − action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AntiAliasing, 0, true); | |
| 373 | − connect(action, &QAction::triggered, [action] { | |
| 374 | − auto renderConfig = qApp->getRenderEngine()->getConfiguration(); | |
| 375 | − if (renderConfig) { | |
| 376 | − auto mainViewJitterCamConfig = renderConfig->getConfig<JitterSample>("RenderMainView.JitterCam"); | |
| 377 | − auto mainViewAntialiasingConfig = renderConfig->getConfig<Antialiasing>("RenderMainView.Antialiasing"); | |
| 378 | − if (mainViewJitterCamConfig && mainViewAntialiasingConfig) { | |
| 379 | − if (action->isChecked()) { | |
| 380 | − mainViewJitterCamConfig->play(); | |
| 381 | − mainViewAntialiasingConfig->setDebugFXAA(false); | |
| 382 | − } else { | |
| 383 | − mainViewJitterCamConfig->none(); | |
| 384 | − mainViewAntialiasingConfig->setDebugFXAA(true); | |
| 385 | − } | |
| 386 | − } | |
| 387 | − } | |
| 388 | − }); | |
| 368 | + addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AntiAliasing, 0, RenderScriptingInterface::getInstance()->getAntialiasingEnabled(), | |
| 369 | + RenderScriptingInterface::getInstance(), SLOT(setAntialiasingEnabled(bool))); | |
| 389 | 370 | |
| 390 | − action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, true); | |
| 391 | − connect(action, &QAction::triggered, [action] { | |
| 392 | − auto renderConfig = qApp->getRenderEngine()->getConfiguration(); | |
| 393 | − if (renderConfig) { | |
| 394 | − auto lightingModelConfig = renderConfig->getConfig<MakeLightingModel>("RenderMainView.LightingModel"); | |
| 395 | − if (lightingModelConfig) { | |
| 396 | − lightingModelConfig->setShadow(action->isChecked()); | |
| 397 | − } | |
| 398 | − } | |
| 399 | − }); | |
| 371 | + addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, RenderScriptingInterface::getInstance()->getShadowsEnabled(), | |
| 372 | + RenderScriptingInterface::getInstance(), SLOT(setShadowsEnabled(bool))); | |
| 400 | 373 | |
| 401 | − action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion, 0, false); | |
| 402 | − connect(action, &QAction::triggered, [action] { | |
| 403 | − auto renderConfig = qApp->getRenderEngine()->getConfiguration(); | |
| 404 | − if (renderConfig) { | |
| 405 | − auto lightingModelConfig = renderConfig->getConfig<MakeLightingModel>("RenderMainView.LightingModel"); | |
| 406 | − if (lightingModelConfig) { | |
| 407 | − lightingModelConfig->setAmbientOcclusion(action->isChecked()); | |
| 408 | − } | |
| 409 | − } | |
| 410 | − }); | |
| 374 | + addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion, 0, RenderScriptingInterface::getInstance()->getAmbientOcclusionEnabled(), | |
| 375 | + RenderScriptingInterface::getInstance(), SLOT(setAmbientOcclusionEnabled(bool))); | |
| 411 | 376 | |
| 412 | 377 | addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::WorldAxes); |
| 413 | 378 | addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DefaultSkybox, 0, true); |