summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2026-05-04 20:00:43 +0200
committerGitHub <noreply@github.com>2026-05-04 20:00:43 +0200
commitefdaf9d8fdc99f79527220617ba0004fb882aad3 (patch)
treeba9c184921087c50054c974b72d06e4791a7dc64
parent76d19f7e430ef14881a1c8edd3a3c37c334e1df1 (diff)
Fix switch and windows CI (#700)
* merge upstream commit to fix some bug * fix merge * add a local user for the merge * Update main.yml * revert main.yml * fix windows CI * fix switch build * fix windows and try a fix for switch * fix windows build
-rw-r--r--.github/workflows/main.yml14
-rw-r--r--src/port/Engine.cpp2
-rw-r--r--src/port/SpaghettiGui.cpp188
-rw-r--r--src/port/ui/PortMenu.cpp2
4 files changed, 101 insertions, 105 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index da76a4cb6..7abea44ae 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -59,18 +59,18 @@ jobs:
submodules: recursive
- name: Build
run: |
- cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A ${{ matrix.arch }} -DCMAKE_BUILD_TYPE=${{ matrix.config }}
- cmake --build ./build/x64 --config ${{ matrix.config }} --parallel 10
+ cmake -S . -B "build/${{ matrix.arch }}" -G "Visual Studio 17 2022" -T v143 -A ${{ matrix.arch }} -DCMAKE_BUILD_TYPE=${{ matrix.config }}
+ cmake --build ./build/${{ matrix.arch }} --config ${{ matrix.config }} --parallel 10
- name: Download spaghetti.o2r
uses: actions/download-artifact@v4
with:
name: spaghetti.o2r
- path: ./build/x64/${{ matrix.config }}
+ path: ./build/${{ matrix.arch }}/${{ matrix.config }}
- name: Create Package
run: |
mkdir spaghetti-${{ matrix.config }}
- mv build/x64/${{ matrix.config }}/Spaghettify.exe spaghetti-${{ matrix.config }}/
- mv build/x64/${{ matrix.config }}/spaghetti.o2r spaghetti-${{ matrix.config }}/
+ mv build/${{ matrix.arch }}/${{ matrix.config }}/Spaghettify.exe spaghetti-${{ matrix.config }}/
+ mv build/${{ matrix.arch }}/${{ matrix.config }}/spaghetti.o2r spaghetti-${{ matrix.config }}/
mv config.yml spaghetti-${{ matrix.config }}/
mv yamls spaghetti-${{ matrix.config }}/
mv meta spaghetti-${{ matrix.config }}/
@@ -79,8 +79,8 @@ jobs:
if: matrix.config == 'Release'
uses: actions/upload-artifact@v4
with:
- name: spaghetti-windows
- path: spaghetti-${{ matrix.arch }}-${{ matrix.config }}
+ name: spaghetti-windows-${{ matrix.arch }}
+ path: spaghetti-${{ matrix.config }}
build-macos-arm64:
needs: generate-port-o2r
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp
index 2cd2c99b9..e55022335 100644
--- a/src/port/Engine.cpp
+++ b/src/port/Engine.cpp
@@ -38,7 +38,7 @@
#include <utility>
#ifdef __SWITCH__
-#include <port/switch/SwitchImpl.h>
+#include <ship/port/switch/SwitchImpl.h>
#endif
extern "C" {
diff --git a/src/port/SpaghettiGui.cpp b/src/port/SpaghettiGui.cpp
index d9c957d3f..56320e2be 100644
--- a/src/port/SpaghettiGui.cpp
+++ b/src/port/SpaghettiGui.cpp
@@ -2,11 +2,7 @@
#include "SpaghettiGui.h"
#include <ship/window/gui/Gui.h>
#include <ship/window/Window.h>
-#ifdef __SWITCH__
-#include "ConfigVersion.h"
-#else
#include "ship/config/Config.h"
-#endif
#ifdef __APPLE__
#include <SDL_hints.h>
@@ -44,120 +40,120 @@ namespace Ship {
#define TOGGLE_BTN ImGuiKey_F1
#define TOGGLE_PAD_BTN ImGuiKey_GamepadBack
- void SpaghettiGui::DrawMenu() {
- const std::shared_ptr<Window> wnd = Context::GetInstance()->GetWindow();
- const std::shared_ptr<Config> conf = Context::GetInstance()->GetConfig();
+void SpaghettiGui::DrawMenu() {
+ const std::shared_ptr<Window> wnd = Context::GetInstance()->GetWindow();
+ const std::shared_ptr<Config> conf = Context::GetInstance()->GetConfig();
- ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground |
- ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove |
- ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus |
- ImGuiWindowFlags_NoResize;
+ ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground |
+ ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove |
+ ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus |
+ ImGuiWindowFlags_NoResize;
- if (GetMenuBar() && GetMenuBar()->IsVisible()) {
- windowFlags |= ImGuiWindowFlags_MenuBar;
- }
+ if (GetMenuBar() && GetMenuBar()->IsVisible()) {
+ windowFlags |= ImGuiWindowFlags_MenuBar;
+ }
- const ImGuiViewport* viewport = ImGui::GetMainViewport();
- ImGui::SetNextWindowPos(viewport->WorkPos);
- ImGui::SetNextWindowSize(ImVec2((int)wnd->GetWidth(), (int)wnd->GetHeight()));
- ImGui::SetNextWindowViewport(viewport->ID);
- ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
- ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
- ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f);
- ImGui::Begin("Main - Deck", nullptr, windowFlags);
- ImGui::PopStyleVar(3);
+ const ImGuiViewport* viewport = ImGui::GetMainViewport();
+ ImGui::SetNextWindowPos(viewport->WorkPos);
+ ImGui::SetNextWindowSize(ImVec2((int) wnd->GetWidth(), (int) wnd->GetHeight()));
+ ImGui::SetNextWindowViewport(viewport->ID);
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
+ ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f);
+ ImGui::Begin("Main - Deck", nullptr, windowFlags);
+ ImGui::PopStyleVar(3);
- mTemporaryWindowPos = ImGui::GetWindowPos();
+ mTemporaryWindowPos = ImGui::GetWindowPos();
- const ImGuiID dockId = ImGui::GetID("main_dock");
- if (!ImGui::DockBuilderGetNode(dockId)) {
- ImGui::DockBuilderRemoveNode(dockId);
- ImGui::DockBuilderAddNode(dockId, ImGuiDockNodeFlags_NoTabBar);
- ImGui::DockBuilderSetNodeSize(dockId, ImVec2(viewport->Size.x, viewport->Size.y));
+ const ImGuiID dockId = ImGui::GetID("main_dock");
+ if (!ImGui::DockBuilderGetNode(dockId)) {
+ ImGui::DockBuilderRemoveNode(dockId);
+ ImGui::DockBuilderAddNode(dockId, ImGuiDockNodeFlags_NoTabBar);
+ ImGui::DockBuilderSetNodeSize(dockId, ImVec2(viewport->Size.x, viewport->Size.y));
- ImGui::DockBuilderDockWindow("Main Game", dockId);
+ ImGui::DockBuilderDockWindow("Main Game", dockId);
- const ImGuiViewport* viewport = ImGui::GetMainViewport();
- const ImGuiID dockId = ImGui::GetID("main_dock");
+ const ImGuiViewport* viewport = ImGui::GetMainViewport();
+ const ImGuiID dockId = ImGui::GetID("main_dock");
- ImGuiID topId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Up, 0.15f, nullptr, nullptr);
- ImGui::DockBuilderSetNodeSize(topId, ImVec2(viewport->Size.x, 40));
+ ImGuiID topId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Up, 0.15f, nullptr, nullptr);
+ ImGui::DockBuilderSetNodeSize(topId, ImVec2(viewport->Size.x, 40));
- ImGuiID bottomId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Down, 0.25f, nullptr, nullptr);
- ImGui::DockBuilderSetNodeSize(bottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.1f));
+ ImGuiID bottomId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Down, 0.25f, nullptr, nullptr);
+ ImGui::DockBuilderSetNodeSize(bottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.1f));
- ImGuiID bottomLeftId = ImGui::DockBuilderSplitNode(bottomId, ImGuiDir_Left, 0.25f, nullptr, nullptr);
- ImGui::DockBuilderSetNodeSize(bottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.1f));
+ ImGuiID bottomLeftId = ImGui::DockBuilderSplitNode(bottomId, ImGuiDir_Left, 0.25f, nullptr, nullptr);
+ ImGui::DockBuilderSetNodeSize(bottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.1f));
- ImGuiID rightId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Right, 0.25f, nullptr, nullptr);
- ImGui::DockBuilderSetNodeSize(rightId, ImVec2(viewport->Size.x * 0.15f, viewport->Size.y));
+ ImGuiID rightId = ImGui::DockBuilderSplitNode(dockId, ImGuiDir_Right, 0.25f, nullptr, nullptr);
+ ImGui::DockBuilderSetNodeSize(rightId, ImVec2(viewport->Size.x * 0.15f, viewport->Size.y));
- // Order of operations matters here for the properties window to be in the right spot
- ImGui::DockBuilderDockWindow("Scene Explorer", rightId);
- ImGui::DockBuilderDockWindow("Track Properties", rightId); // Attach as second tab
+ // Order of operations matters here for the properties window to be in the right spot
+ ImGui::DockBuilderDockWindow("Scene Explorer", rightId);
+ ImGui::DockBuilderDockWindow("Track Properties", rightId); // Attach as second tab
- ImGuiID rightBottomId = ImGui::DockBuilderSplitNode(rightId, ImGuiDir_Down, 0.25f, nullptr, nullptr);
- ImGui::DockBuilderSetNodeSize(rightBottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.25));
+ ImGuiID rightBottomId = ImGui::DockBuilderSplitNode(rightId, ImGuiDir_Down, 0.25f, nullptr, nullptr);
+ ImGui::DockBuilderSetNodeSize(rightBottomId, ImVec2(viewport->Size.x, viewport->Size.y * 0.25));
- ImGui::DockBuilderDockWindow("Properties", rightBottomId);
- ImGui::DockBuilderDockWindow("Tools", topId);
- ImGui::DockBuilderDockWindow("Content Browser", bottomLeftId);
+ ImGui::DockBuilderDockWindow("Properties", rightBottomId);
+ ImGui::DockBuilderDockWindow("Tools", topId);
+ ImGui::DockBuilderDockWindow("Content Browser", bottomLeftId);
- ImGui::DockBuilderFinish(dockId);
- }
+ ImGui::DockBuilderFinish(dockId);
+ }
- ImGui::DockSpace(dockId, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_NoDockingInCentralNode);
-
- if (ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(ImGuiKey_Escape) ||
- (ImGui::IsKeyPressed(TOGGLE_PAD_BTN) && CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0))) {
- if ((ImGui::IsKeyPressed(ImGuiKey_Escape) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenu()) {
- GetMenu()->ToggleVisibility();
- } else if ((ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenuBar()) {
- Gui::GetMenuBar()->ToggleVisibility();
- }
- if (wnd->IsFullscreen()) {
- Context::GetInstance()->GetWindow()->SetMouseCapture(
- !(GetMenuOrMenubarVisible() || wnd->ShouldForceCursorVisibility()));
- }
- if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && GetMenuOrMenubarVisible()) {
- mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
- } else {
- mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;
- }
- }
+ ImGui::DockSpace(dockId, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_NoDockingInCentralNode);
- #if __APPLE__
- if ((ImGui::IsKeyDown(ImGuiKey_LeftSuper) || ImGui::IsKeyDown(ImGuiKey_RightSuper)) &&
- ImGui::IsKeyPressed(ImGuiKey_R, false)) {
- std::reinterpret_pointer_cast<ConsoleWindow>(
- Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
- ->Dispatch("reset");
+ if (ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(ImGuiKey_Escape) ||
+ (ImGui::IsKeyPressed(TOGGLE_PAD_BTN) && CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0))) {
+ if ((ImGui::IsKeyPressed(ImGuiKey_Escape) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenu()) {
+ GetMenu()->ToggleVisibility();
+ } else if ((ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) && GetMenuBar()) {
+ Gui::GetMenuBar()->ToggleVisibility();
}
- #else
- if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
- ImGui::IsKeyPressed(ImGuiKey_R, false)) {
- std::reinterpret_pointer_cast<ConsoleWindow>(
- Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
- ->Dispatch("reset");
+ if (wnd->IsFullscreen()) {
+ Context::GetInstance()->GetWindow()->SetMouseCapture(
+ !(GetMenuOrMenubarVisible() || wnd->ShouldForceCursorVisibility()));
}
- #endif
-
- if (GetMenuBar()) {
- GetMenuBar()->Update();
- GetMenuBar()->Draw();
+ if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && GetMenuOrMenubarVisible()) {
+ mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
+ } else {
+ mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;
}
+ }
- if (GetMenu()) {
- GetMenu()->Update();
- GetMenu()->Draw();
- }
+#if __APPLE__
+ if ((ImGui::IsKeyDown(ImGuiKey_LeftSuper) || ImGui::IsKeyDown(ImGuiKey_RightSuper)) &&
+ ImGui::IsKeyPressed(ImGuiKey_R, false)) {
+ std::reinterpret_pointer_cast<ConsoleWindow>(
+ Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
+ ->Dispatch("reset");
+ }
+#else
+ if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
+ ImGui::IsKeyPressed(ImGuiKey_R, false)) {
+ std::reinterpret_pointer_cast<ConsoleWindow>(
+ Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
+ ->Dispatch("reset");
+ }
+#endif
- for (auto& windowIter : mGuiWindows) {
- windowIter.second->Update();
- windowIter.second->Draw();
- }
+ if (GetMenuBar()) {
+ GetMenuBar()->Update();
+ GetMenuBar()->Draw();
+ }
- ImGui::End();
+ if (GetMenu()) {
+ GetMenu()->Update();
+ GetMenu()->Draw();
}
-} \ No newline at end of file
+ for (auto& windowIter : mGuiWindows) {
+ windowIter.second->Update();
+ windowIter.second->Draw();
+ }
+
+ ImGui::End();
+}
+
+} // namespace Ship
diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp
index 6ceffb5eb..15142be35 100644
--- a/src/port/ui/PortMenu.cpp
+++ b/src/port/ui/PortMenu.cpp
@@ -15,7 +15,7 @@
#include "engine/tracks/ToadsTurnpike.h"
#ifdef __SWITCH__
-#include <port/switch/SwitchImpl.h>
+#include <ship/port/switch/SwitchImpl.h>
#endif
extern "C" {