diff --git a/Apps/CLI/Src/main.cpp b/Apps/CLI/Src/main.cpp index 2bd9487d..b27106dc 100644 --- a/Apps/CLI/Src/main.cpp +++ b/Apps/CLI/Src/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,7 @@ #include + using namespace rift; @@ -64,7 +66,7 @@ namespace rift int main(int argc, char** argv) { p::Initialize("Saved/Logs"); - p::Info(p::GetUserSettingsPath()); + p::Info(p::PlatformPaths::GetUserSettingsPath()); EnableModule(); EnableModule(); EnableModule(); diff --git a/Extern/Pipe b/Extern/Pipe index cf14a81d..bd62c813 160000 --- a/Extern/Pipe +++ b/Extern/Pipe @@ -1 +1 @@ -Subproject commit cf14a81d45647e87363ea2d382cde3770d2223a7 +Subproject commit bd62c813a1b277e1500f9aab169d11c8877a0784 diff --git a/Libs/AST/Include/AST/Utils/ModuleFileIterator.h b/Libs/AST/Include/AST/Utils/ModuleFileIterator.h index 463f2026..f76341ac 100644 --- a/Libs/AST/Include/AST/Utils/ModuleFileIterator.h +++ b/Libs/AST/Include/AST/Utils/ModuleFileIterator.h @@ -9,9 +9,9 @@ namespace rift::ast { - class ModuleFileIterator : public p::LambdaFileIterator + class ModuleFileIterator : public p::LambdaFileIterator { - using Super = p::LambdaFileIterator; + using Super = p::LambdaFileIterator; public: using Super::Super; diff --git a/Libs/AST/Include/AST/Utils/TypeIterator.h b/Libs/AST/Include/AST/Utils/TypeIterator.h index f4313b53..3ed526cf 100644 --- a/Libs/AST/Include/AST/Utils/TypeIterator.h +++ b/Libs/AST/Include/AST/Utils/TypeIterator.h @@ -9,9 +9,9 @@ namespace rift::ast { - class TypeIterator : public p::LambdaFileIterator + class TypeIterator : public p::LambdaFileIterator { - using Super = p::LambdaFileIterator; + using Super = p::LambdaFileIterator; public: using Super::Super; diff --git a/Libs/Bindings/Native/Compiler/Include/HeaderIterator.h b/Libs/Bindings/Native/Compiler/Include/HeaderIterator.h index 46018ffd..ada4bb47 100644 --- a/Libs/Bindings/Native/Compiler/Include/HeaderIterator.h +++ b/Libs/Bindings/Native/Compiler/Include/HeaderIterator.h @@ -9,9 +9,9 @@ namespace rift { - class HeaderIterator : public p::LambdaFileIterator + class HeaderIterator : public p::LambdaFileIterator { - using Super = p::LambdaFileIterator; + using Super = p::LambdaFileIterator; public: using Super::Super; diff --git a/Libs/Editor/Include/Editor.h b/Libs/Editor/Include/Editor.h index b62ab703..fdd0008b 100644 --- a/Libs/Editor/Include/Editor.h +++ b/Libs/Editor/Include/Editor.h @@ -1,7 +1,7 @@ // Copyright 2015-2023 Piperift - All rights reserved #pragma once -#include "Pipe/Files/FileWatcher.h" +#include "PipeFiles.h" #include #include diff --git a/Libs/Editor/Include/Statics/SEditor.h b/Libs/Editor/Include/Statics/SEditor.h index 578b7af0..d3acf628 100644 --- a/Libs/Editor/Include/Statics/SEditor.h +++ b/Libs/Editor/Include/Statics/SEditor.h @@ -9,12 +9,13 @@ #include "Tools/MemoryDebugger.h" #include "Tools/ReflectionDebugger.h" -#include #include #include +#include #include + namespace rift::Editor { struct SEditor : public Struct diff --git a/Libs/Editor/Src/Panels/FileExplorerPanel.cpp b/Libs/Editor/Src/Panels/FileExplorerPanel.cpp index cd0ba285..c6030b70 100644 --- a/Libs/Editor/Src/Panels/FileExplorerPanel.cpp +++ b/Libs/Editor/Src/Panels/FileExplorerPanel.cpp @@ -18,12 +18,12 @@ #include #include #include -#include #include -#include #include #include +#include #include +#include #include #include #include @@ -175,7 +175,7 @@ namespace rift::Editor if (UI::MenuItem("Show in Explorer")) { - PlatformProcess::ShowFolder(path); + PlatformPaths::ShowFolder(path); } } @@ -478,7 +478,7 @@ namespace rift::Editor void FileExplorerPanel::CreateType( ast::Tree& ast, StringView title, p::Tag typeId, p::StringView folderPath) { - const p::String path = files::SaveFileDialog(title, folderPath, + const p::String path = p::SaveFileDialog(title, folderPath, { {"Rift Type", Strings::Format("*.{}", Paths::typeExtension)} }, diff --git a/Libs/Editor/Src/Systems/EditorSystem.cpp b/Libs/Editor/Src/Systems/EditorSystem.cpp index fb9618b7..0db7461e 100644 --- a/Libs/Editor/Src/Systems/EditorSystem.cpp +++ b/Libs/Editor/Src/Systems/EditorSystem.cpp @@ -26,10 +26,11 @@ #include #include #include -#include #include +#include #include #include +#include #include #include #include @@ -257,8 +258,8 @@ namespace rift::Editor::EditorSystem { if (UI::MenuItem("Open Project")) { - const p::String folder = - files::SelectFolderDialog("Select project folder", p::GetCurrentPath()); + const p::String folder = p::SelectFolderDialog( + "Select project folder", p::PlatformPaths::GetCurrentPath()); if (Editor::Get().OpenProject(folder)) { editorData.skipFrameAfterMenu = true; diff --git a/Libs/Editor/Src/Utils/ProjectManager.cpp b/Libs/Editor/Src/Utils/ProjectManager.cpp index 42a26bac..55a0274b 100644 --- a/Libs/Editor/Src/Utils/ProjectManager.cpp +++ b/Libs/Editor/Src/Utils/ProjectManager.cpp @@ -3,7 +3,8 @@ #include "Editor.h" #include "Utils/ElementsPanel.h" -#include +#include +#include #include #include @@ -83,8 +84,8 @@ namespace rift::Editor UI::SameLine(); if (UI::Button("...", p::v2{24.f, 0.f})) { - p::String selectedFolder = - p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath()); + p::String selectedFolder = p::SelectFolderDialog( + "Select project folder", p::PlatformPaths::GetCurrentPath()); folder = p::ToString(selectedFolder); } } @@ -93,8 +94,8 @@ namespace rift::Editor ImGui::TableNextColumn(); if (UI::Button("Open", p::v2{-FLT_MIN, 0.0f})) { - p::String folder = - p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath()); + p::String folder = p::SelectFolderDialog( + "Select project folder", p::PlatformPaths::GetCurrentPath()); if (Editor::Get().OpenProject(folder)) { UI::CloseCurrentPopup(); diff --git a/Libs/UI/Include/UI/Paths.h b/Libs/UI/Include/UI/Paths.h index df4e11b5..8605df1a 100644 --- a/Libs/UI/Include/UI/Paths.h +++ b/Libs/UI/Include/UI/Paths.h @@ -8,4 +8,5 @@ namespace rift::Paths { p::String GetResourcesPath(); + p::String GetUserSettingsPath(); }; // namespace rift::Paths diff --git a/Libs/UI/Src/Paths.cpp b/Libs/UI/Src/Paths.cpp index f0c9fe38..d1c72f99 100644 --- a/Libs/UI/Src/Paths.cpp +++ b/Libs/UI/Src/Paths.cpp @@ -2,12 +2,20 @@ #include "UI/Paths.h" +#include + namespace rift::Paths { p::String GetResourcesPath() { - static p::StringView relativeResourcesPath{"./Resources"}; - return p::JoinPaths(p::GetBasePath(), relativeResourcesPath); + static p::StringView relativeResourcesPath{"Resources"}; + return p::JoinPaths(p::PlatformPaths::GetBasePath(), relativeResourcesPath); + } + + p::String GetUserSettingsPath() + { + static p::StringView relativeSettingsPath{"Rift"}; + return p::JoinPaths(p::PlatformPaths::GetUserSettingsPath(), relativeSettingsPath); } }; // namespace rift::Paths diff --git a/Libs/UI/Src/Window.cpp b/Libs/UI/Src/Window.cpp index c96d7a3d..b638cd09 100644 --- a/Libs/UI/Src/Window.cpp +++ b/Libs/UI/Src/Window.cpp @@ -17,8 +17,10 @@ #include #include #include +#include #include + #define STB_IMAGE_IMPLEMENTATION #include @@ -173,11 +175,12 @@ namespace rift::UI void SetWindowIcon() { - p::String icon64Path = p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_64.png"); + p::String icon64Path = + p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_64.png"); p::String icon128Path = - p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_128.png"); + p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_128.png"); p::String icon256Path = - p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_256.png"); + p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_256.png"); GLFWimage images[3]; images[0].pixels = stbi_load(icon64Path.c_str(), &images[0].width, &images[0].height, nullptr, 0); diff --git a/Tests/Project.spec.cpp b/Tests/Project.spec.cpp index e3ac75d5..aee24b86 100644 --- a/Tests/Project.spec.cpp +++ b/Tests/Project.spec.cpp @@ -6,19 +6,21 @@ #include #include #include +#include #include #include #include + using namespace snowhouse; using namespace bandit; using namespace rift; using namespace p; using namespace std::chrono_literals; -String testProjectPath = p::JoinPaths(GetCurrentPath(), "TestProject"); +String testProjectPath = p::JoinPaths(PlatformPaths::GetCurrentPath(), "TestProject"); go_bandit([]() {