Refactor editor host resource boundary
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include "Runtime/EditorWindowScreenshotController.h"
|
||||
|
||||
#include "ExecutablePath.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <sstream>
|
||||
@@ -11,8 +9,10 @@ namespace XCEngine::UI::Editor::App {
|
||||
|
||||
namespace {
|
||||
|
||||
std::filesystem::path ResolveBuildCaptureRoot(const std::filesystem::path& requestedCaptureRoot) {
|
||||
std::filesystem::path captureRoot = App::GetExecutableDirectory() / "captures";
|
||||
std::filesystem::path ResolveBuildCaptureRoot(
|
||||
const std::filesystem::path& requestedCaptureRoot,
|
||||
const std::filesystem::path& executableDirectory) {
|
||||
std::filesystem::path captureRoot = executableDirectory / "captures";
|
||||
const std::filesystem::path scenarioPath = requestedCaptureRoot.parent_path().filename();
|
||||
if (!scenarioPath.empty() && scenarioPath != "captures") {
|
||||
captureRoot /= scenarioPath;
|
||||
@@ -23,8 +23,10 @@ std::filesystem::path ResolveBuildCaptureRoot(const std::filesystem::path& reque
|
||||
|
||||
} // namespace
|
||||
|
||||
void EditorWindowScreenshotController::Initialize(const std::filesystem::path& captureRoot) {
|
||||
m_captureRoot = ResolveBuildCaptureRoot(captureRoot);
|
||||
void EditorWindowScreenshotController::Initialize(
|
||||
const std::filesystem::path& captureRoot,
|
||||
const std::filesystem::path& executableDirectory) {
|
||||
m_captureRoot = ResolveBuildCaptureRoot(captureRoot, executableDirectory);
|
||||
m_historyRoot = (m_captureRoot / "history").lexically_normal();
|
||||
m_latestCapturePath = (m_captureRoot / "latest.png").lexically_normal();
|
||||
m_activeHistoryCapturePath.clear();
|
||||
|
||||
Reference in New Issue
Block a user