#pragma once #include #include namespace XCEngine::UI::Editor::App { inline ::XCEngine::Containers::String NormalizeSceneViewportResourcePath( const std::filesystem::path& path) { return ::XCEngine::Containers::String( path.lexically_normal().generic_string().c_str()); } inline std::filesystem::path GetSceneViewportResourceRepoRootPath() { #ifdef XCUIEDITOR_REPO_ROOT return std::filesystem::path(XCUIEDITOR_REPO_ROOT); #else return std::filesystem::path(__FILE__) .parent_path() .parent_path() .parent_path() .parent_path() .parent_path(); #endif } inline ::XCEngine::Containers::String BuildSceneViewportResourcePath( const std::filesystem::path& relativePath) { return NormalizeSceneViewportResourcePath( GetSceneViewportResourceRepoRootPath() / "editor" / "resources" / relativePath); } inline ::XCEngine::Containers::String GetSceneViewportInfiniteGridShaderPath() { return BuildSceneViewportResourcePath( std::filesystem::path("shaders") / "scene-viewport" / "infinite-grid" / "infinite-grid.shader"); } inline ::XCEngine::Containers::String GetSceneViewportSelectionMaskShaderPath() { return BuildSceneViewportResourcePath( std::filesystem::path("shaders") / "scene-viewport" / "selection-mask" / "selection-mask.shader"); } inline ::XCEngine::Containers::String GetSceneViewportSelectionOutlineShaderPath() { return BuildSceneViewportResourcePath( std::filesystem::path("shaders") / "scene-viewport" / "selection-outline" / "selection-outline.shader"); } } // namespace XCEngine::UI::Editor::App