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
This commit is contained in:
coco875
2026-05-04 20:00:43 +02:00
committed by GitHub
parent 76d19f7e43
commit efdaf9d8fd
4 changed files with 122 additions and 126 deletions
+7 -7
View File
@@ -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
+1 -1
View File
@@ -38,7 +38,7 @@
#include <utility>
#ifdef __SWITCH__
#include <port/switch/SwitchImpl.h>
#include <ship/port/switch/SwitchImpl.h>
#endif
extern "C" {
+113 -117
View File
@@ -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;
}
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();
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);
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 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 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
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::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;
}
}
#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
if (GetMenuBar()) {
GetMenuBar()->Update();
GetMenuBar()->Draw();
}
if (GetMenu()) {
GetMenu()->Update();
GetMenu()->Draw();
}
for (auto& windowIter : mGuiWindows) {
windowIter.second->Update();
windowIter.second->Draw();
}
ImGui::End();
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);
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));
ImGui::DockBuilderDockWindow("Main Game", dockId);
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 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 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
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::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;
}
}
#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
if (GetMenuBar()) {
GetMenuBar()->Update();
GetMenuBar()->Draw();
}
if (GetMenu()) {
GetMenu()->Update();
GetMenu()->Draw();
}
for (auto& windowIter : mGuiWindows) {
windowIter.second->Update();
windowIter.second->Draw();
}
ImGui::End();
}
} // namespace Ship
+1 -1
View File
@@ -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" {