Build fixes

- Fix WIN32 issue in CMain
- Remove usages of spaceship operator for GCC 9
This commit is contained in:
Luke Street 2022-06-13 01:33:41 -04:00
parent 5fb8b1237e
commit 01e887e8a3
5 changed files with 20 additions and 16 deletions

View File

@ -498,11 +498,6 @@ public:
} // namespace metaforce } // namespace metaforce
static void SetupBasics() { static void SetupBasics() {
#if _WIN32
if (logging && GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == FILE_TYPE_UNKNOWN)
logvisor::CreateWin32Console();
#endif
auto result = zeus::validateCPU(); auto result = zeus::validateCPU();
if (!result.first) { if (!result.first) {
#if _WIN32 && !WINDOWS_STORE #if _WIN32 && !WINDOWS_STORE
@ -533,6 +528,10 @@ static bool IsClientLoggingEnabled(int argc, char** argv) {
return false; return false;
} }
static void SetupLogging() {
}
#if !WINDOWS_STORE #if !WINDOWS_STORE
int main(int argc, char** argv) { int main(int argc, char** argv) {
// TODO: This seems to fix a lot of weird issues with rounding // TODO: This seems to fix a lot of weird issues with rounding
@ -556,12 +555,19 @@ int main(int argc, char** argv) {
do { do {
metaforce::CVarManager cvarMgr{fileMgr}; metaforce::CVarManager cvarMgr{fileMgr};
metaforce::CVarCommons cvarCmns{cvarMgr}; metaforce::CVarCommons cvarCmns{cvarMgr};
if (!restart) { if (!restart) {
cvarMgr.parseCommandLine(args); cvarMgr.parseCommandLine(args);
// TODO add clear loggers func to logvisor so we can recreate loggers on restart // 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(); logvisor::RegisterStandardExceptions();
if (IsClientLoggingEnabled(argc, argv)) { if (logging) {
logvisor::RegisterConsoleLogger(); logvisor::RegisterConsoleLogger();
} }
@ -575,6 +581,7 @@ int main(int argc, char** argv) {
logvisor::RegisterFileLogger(logFilePath.c_str()); logvisor::RegisterFileLogger(logFilePath.c_str());
} }
} }
auto app = std::make_unique<metaforce::Application>(fileMgr, cvarMgr, cvarCmns); auto app = std::make_unique<metaforce::Application>(fileMgr, cvarMgr, cvarCmns);
auto icon = metaforce::GetIcon(); auto icon = metaforce::GetIcon();
auto data = aurora::Icon{ auto data = aurora::Icon{

View File

@ -3,8 +3,6 @@
#include "Graphics/GX.hpp" #include "Graphics/GX.hpp"
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include <compare>
namespace metaforce { namespace metaforce {
enum class ERglTevStage : std::underlying_type_t<GX::TevStageID> { enum class ERglTevStage : std::underlying_type_t<GX::TevStageID> {
Stage0 = GX::TEVSTAGE0, Stage0 = GX::TEVSTAGE0,
@ -45,7 +43,7 @@ struct CTevOp {
, xc_scale(static_cast<GX::TevScale>(compressedDesc >> 6 & 3)) , xc_scale(static_cast<GX::TevScale>(compressedDesc >> 6 & 3))
, x10_regId(static_cast<GX::TevRegID>(compressedDesc >> 9 & 3)) {} , x10_regId(static_cast<GX::TevRegID>(compressedDesc >> 9 & 3)) {}
auto operator<=>(const CTevOp&) const = default; bool operator==(const CTevOp&) const = default;
}; };
struct ColorPass { struct ColorPass {
GX::TevColorArg x0_a; GX::TevColorArg x0_a;
@ -61,7 +59,7 @@ struct ColorPass {
, x8_c(static_cast<GX::TevColorArg>(compressedDesc >> 10 & 0x1F)) , x8_c(static_cast<GX::TevColorArg>(compressedDesc >> 10 & 0x1F))
, xc_d(static_cast<GX::TevColorArg>(compressedDesc >> 15 & 0x1F)) {} , xc_d(static_cast<GX::TevColorArg>(compressedDesc >> 15 & 0x1F)) {}
auto operator<=>(const ColorPass&) const = default; bool operator==(const ColorPass&) const = default;
}; };
struct AlphaPass { struct AlphaPass {
GX::TevAlphaArg x0_a; GX::TevAlphaArg x0_a;
@ -77,7 +75,7 @@ struct AlphaPass {
, x8_c(static_cast<GX::TevAlphaArg>(compressedDesc >> 10 & 0x1F)) , x8_c(static_cast<GX::TevAlphaArg>(compressedDesc >> 10 & 0x1F))
, xc_d(static_cast<GX::TevAlphaArg>(compressedDesc >> 15 & 0x1F)) {} , xc_d(static_cast<GX::TevAlphaArg>(compressedDesc >> 15 & 0x1F)) {}
auto operator<=>(const AlphaPass&) const = default; bool operator==(const AlphaPass&) const = default;
}; };
class CTevPass { class CTevPass {
u32 x0_id; u32 x0_id;
@ -98,7 +96,7 @@ public:
void Execute(ERglTevStage stage) const; void Execute(ERglTevStage stage) const;
auto operator<=>(const CTevPass&) const = default; bool operator==(const CTevPass&) const = default;
}; };
extern const CTevPass skPassThru; extern const CTevPass skPassThru;

View File

@ -178,7 +178,7 @@ struct WindowSize {
uint32_t fb_height; uint32_t fb_height;
float scale; float scale;
auto operator<=>(const WindowSize& rhs) const = default; bool operator==(const WindowSize& rhs) const = default;
}; };
enum class MouseButton { enum class MouseButton {
None = 0, None = 0,

View File

@ -1,7 +1,6 @@
#pragma once #pragma once
#include <array> #include <array>
#include <compare>
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
@ -501,7 +500,7 @@ public:
[[nodiscard]] constexpr bool IsSet(Flags<BitType> const bit) const noexcept { return bool(*this & bit); } [[nodiscard]] constexpr bool IsSet(Flags<BitType> const bit) const noexcept { return bool(*this & bit); }
// relational operators // relational operators
auto operator<=>(Flags<BitType> const&) const noexcept = default; bool operator==(Flags<BitType> const&) const noexcept = default;
// logical operator // logical operator
constexpr bool operator!() const noexcept { return !m_mask; } constexpr bool operator!() const noexcept { return !m_mask; }

View File

@ -73,7 +73,7 @@ struct Command {
uint32_t y; uint32_t y;
uint32_t w; uint32_t w;
uint32_t h; uint32_t h;
auto operator<=>(const SetScissorCommand&) const = default; bool operator==(const SetScissorCommand&) const = default;
} setScissor; } setScissor;
ShaderDrawCommand draw; ShaderDrawCommand draw;
} data; } data;