editor: centralize engine runtime access
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "ViewportHostService.h"
|
||||
|
||||
#include "Engine/EditorEngineServices.h"
|
||||
#include "Panels/EditorPanelIds.h"
|
||||
#include "Product/EditorProductManifest.h"
|
||||
#include "Viewport/SceneViewportResourcePaths.h"
|
||||
@@ -41,12 +42,18 @@ private:
|
||||
|
||||
} // namespace
|
||||
|
||||
ViewportHostService::ViewportHostService() = default;
|
||||
ViewportHostService::ViewportHostService(EditorEngineServices* engineServices)
|
||||
: m_engineServices(engineServices) {}
|
||||
|
||||
ViewportHostService::~ViewportHostService() = default;
|
||||
|
||||
void ViewportHostService::Initialize(const EditorRuntimePaths& runtimePaths) {
|
||||
m_sceneViewportRuntime.Initialize(BuildSceneViewportShaderPaths(runtimePaths));
|
||||
void ViewportHostService::Initialize(
|
||||
const EditorRuntimePaths& runtimePaths,
|
||||
EditorEngineServices& engineServices) {
|
||||
m_engineServices = &engineServices;
|
||||
m_sceneViewportRuntime.Initialize(
|
||||
BuildSceneViewportShaderPaths(runtimePaths),
|
||||
engineServices);
|
||||
m_placeholderRenderers.clear();
|
||||
for (const EditorProductPanelDescriptor& panel : GetEditorProductPanels()) {
|
||||
if (panel.presentationKind != UIEditorPanelPresentationKind::ViewportShell) {
|
||||
@@ -123,6 +130,7 @@ void ViewportHostService::Shutdown() {
|
||||
m_windowRenderer = nullptr;
|
||||
m_device = nullptr;
|
||||
m_surfacePresentationEnabled = false;
|
||||
m_engineServices = nullptr;
|
||||
m_entries.clear();
|
||||
m_retiredTargetsBySlot.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user