feat(editor): persist graphics settings and shadow overrides
This commit is contained in:
42
engine/src/Rendering/GraphicsSettingsState.cpp
Normal file
42
engine/src/Rendering/GraphicsSettingsState.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "Rendering/GraphicsSettingsState.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Rendering {
|
||||
|
||||
GraphicsSettingsState& GetGraphicsSettingsState() {
|
||||
static GraphicsSettingsState s_state;
|
||||
return s_state;
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::SetManagedRenderPipelineBridge(
|
||||
std::shared_ptr<const Pipelines::ManagedRenderPipelineBridge> bridge) {
|
||||
m_managedRenderPipelineBridge = std::move(bridge);
|
||||
++m_managedRenderPipelineBridgeGeneration;
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::ClearManagedRenderPipelineBridge() {
|
||||
m_managedRenderPipelineBridge.reset();
|
||||
++m_managedRenderPipelineBridgeGeneration;
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::SetRenderPipelineAssetDescriptor(
|
||||
const Pipelines::ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
m_renderPipelineAssetDescriptor = descriptor;
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::ClearRenderPipelineAssetDescriptor() {
|
||||
m_renderPipelineAssetDescriptor = {};
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::BumpEnvironmentGeneration() {
|
||||
++m_environmentGeneration;
|
||||
}
|
||||
|
||||
} // namespace Rendering
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user