From 01e887e8a3cb2432a0a59b6b049005da8e0ce4a2 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 13 Jun 2022 01:33:41 -0400 Subject: [PATCH] Build fixes - Fix WIN32 issue in CMain - Remove usages of spaceship operator for GCC 9 --- Runtime/CMain.cpp | 19 +++++++++++++------ Runtime/Graphics/CTevCombiners.hpp | 10 ++++------ aurora/include/aurora/aurora.hpp | 2 +- aurora/include/aurora/common.hpp | 3 +-- aurora/lib/gfx/common.cpp | 2 +- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Runtime/CMain.cpp b/Runtime/CMain.cpp index 2ce8929bb..b2010ea2e 100644 --- a/Runtime/CMain.cpp +++ b/Runtime/CMain.cpp @@ -498,11 +498,6 @@ public: } // namespace metaforce static void SetupBasics() { -#if _WIN32 - if (logging && GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == FILE_TYPE_UNKNOWN) - logvisor::CreateWin32Console(); -#endif - auto result = zeus::validateCPU(); if (!result.first) { #if _WIN32 && !WINDOWS_STORE @@ -533,6 +528,10 @@ static bool IsClientLoggingEnabled(int argc, char** argv) { return false; } +static void SetupLogging() { + +} + #if !WINDOWS_STORE int main(int argc, char** argv) { // TODO: This seems to fix a lot of weird issues with rounding @@ -556,12 +555,19 @@ int main(int argc, char** argv) { do { metaforce::CVarManager cvarMgr{fileMgr}; metaforce::CVarCommons cvarCmns{cvarMgr}; + if (!restart) { cvarMgr.parseCommandLine(args); // TODO add clear loggers func to logvisor so we can recreate loggers on restart + bool logging = IsClientLoggingEnabled(argc, argv); +#if _WIN32 + if (logging && GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == FILE_TYPE_UNKNOWN) { + logvisor::CreateWin32Console(); + } +#endif logvisor::RegisterStandardExceptions(); - if (IsClientLoggingEnabled(argc, argv)) { + if (logging) { logvisor::RegisterConsoleLogger(); } @@ -575,6 +581,7 @@ int main(int argc, char** argv) { logvisor::RegisterFileLogger(logFilePath.c_str()); } } + auto app = std::make_unique(fileMgr, cvarMgr, cvarCmns); auto icon = metaforce::GetIcon(); auto data = aurora::Icon{ diff --git a/Runtime/Graphics/CTevCombiners.hpp b/Runtime/Graphics/CTevCombiners.hpp index 81df6db05..18fe9072c 100644 --- a/Runtime/Graphics/CTevCombiners.hpp +++ b/Runtime/Graphics/CTevCombiners.hpp @@ -3,8 +3,6 @@ #include "Graphics/GX.hpp" #include "RetroTypes.hpp" -#include - namespace metaforce { enum class ERglTevStage : std::underlying_type_t { Stage0 = GX::TEVSTAGE0, @@ -45,7 +43,7 @@ struct CTevOp { , xc_scale(static_cast(compressedDesc >> 6 & 3)) , x10_regId(static_cast(compressedDesc >> 9 & 3)) {} - auto operator<=>(const CTevOp&) const = default; + bool operator==(const CTevOp&) const = default; }; struct ColorPass { GX::TevColorArg x0_a; @@ -61,7 +59,7 @@ struct ColorPass { , x8_c(static_cast(compressedDesc >> 10 & 0x1F)) , xc_d(static_cast(compressedDesc >> 15 & 0x1F)) {} - auto operator<=>(const ColorPass&) const = default; + bool operator==(const ColorPass&) const = default; }; struct AlphaPass { GX::TevAlphaArg x0_a; @@ -77,7 +75,7 @@ struct AlphaPass { , x8_c(static_cast(compressedDesc >> 10 & 0x1F)) , xc_d(static_cast(compressedDesc >> 15 & 0x1F)) {} - auto operator<=>(const AlphaPass&) const = default; + bool operator==(const AlphaPass&) const = default; }; class CTevPass { u32 x0_id; @@ -98,7 +96,7 @@ public: void Execute(ERglTevStage stage) const; - auto operator<=>(const CTevPass&) const = default; + bool operator==(const CTevPass&) const = default; }; extern const CTevPass skPassThru; diff --git a/aurora/include/aurora/aurora.hpp b/aurora/include/aurora/aurora.hpp index ed48c4593..aa1818ea5 100644 --- a/aurora/include/aurora/aurora.hpp +++ b/aurora/include/aurora/aurora.hpp @@ -178,7 +178,7 @@ struct WindowSize { uint32_t fb_height; float scale; - auto operator<=>(const WindowSize& rhs) const = default; + bool operator==(const WindowSize& rhs) const = default; }; enum class MouseButton { None = 0, diff --git a/aurora/include/aurora/common.hpp b/aurora/include/aurora/common.hpp index 68f806263..7d79c7d23 100644 --- a/aurora/include/aurora/common.hpp +++ b/aurora/include/aurora/common.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include @@ -501,7 +500,7 @@ public: [[nodiscard]] constexpr bool IsSet(Flags const bit) const noexcept { return bool(*this & bit); } // relational operators - auto operator<=>(Flags const&) const noexcept = default; + bool operator==(Flags const&) const noexcept = default; // logical operator constexpr bool operator!() const noexcept { return !m_mask; } diff --git a/aurora/lib/gfx/common.cpp b/aurora/lib/gfx/common.cpp index d8d2db486..25c3844a4 100644 --- a/aurora/lib/gfx/common.cpp +++ b/aurora/lib/gfx/common.cpp @@ -73,7 +73,7 @@ struct Command { uint32_t y; uint32_t w; uint32_t h; - auto operator<=>(const SetScissorCommand&) const = default; + bool operator==(const SetScissorCommand&) const = default; } setScissor; ShaderDrawCommand draw; } data;