Fixed some compilation errors

This commit is contained in:
KiritoDv
2025-03-05 18:31:53 -06:00
parent 4b49902ba6
commit f500ac3a4a
5 changed files with 61 additions and 13 deletions
+14
View File
@@ -44,6 +44,10 @@
#include <Fast3D/gfx_pc.h>
#include <filesystem>
#ifdef __SWITCH__
#include <port/switch/SwitchImpl.h>
#endif
namespace fs = std::filesystem;
extern "C" {
@@ -59,6 +63,11 @@ std::vector<uint8_t*> MemoryPool;
GameEngine* GameEngine::Instance;
GameEngine::GameEngine() {
#ifdef __SWITCH__
Ship::Switch::Init(Ship::PreInitPhase);
Ship::Switch::Init(Ship::PostInitPhase);
#endif
std::vector<std::string> archiveFiles;
const std::string main_path = Ship::Context::GetPathRelativeToAppDirectory("sf64.o2r");
const std::string assets_path = Ship::Context::GetPathRelativeToAppDirectory("starship.o2r");
@@ -159,9 +168,11 @@ GameEngine::GameEngine() {
this->context->Init(archiveFiles, {}, 3, { 32000, 1024, 1680 }, window, controlDeck);
#ifndef __SWITCH__
Ship::Context::GetInstance()->GetLogger()->set_level(
(spdlog::level::level_enum) CVarGetInteger("gDeveloperTools.LogLevel", 1));
Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v");
#endif
auto loader = context->GetResourceManager()->GetResourceLoader();
loader->RegisterResourceFactory(std::make_shared<SF64::ResourceFactoryBinaryAnimV0>(), RESOURCE_FORMAT_BINARY,
@@ -289,6 +300,9 @@ void GameEngine::Destroy() {
free(ptr);
}
MemoryPool.clear();
#ifdef __SWITCH__
Ship::Switch::Exit();
#endif
}
void GameEngine::StartFrame() const {
+4 -2
View File
@@ -4,8 +4,10 @@
#include "Context.h"
#include "spdlog/spdlog.h"
#include "portable-file-dialogs.h"
#include <port/Engine.h>
#if !defined(__IOS__) && !defined(__ANDROID__) && !defined(__SWITCH__)
#include "portable-file-dialogs.h"
#endif
std::unordered_map<std::string, std::string> mGameList = {
{ "d8b1088520f7c5f81433292a9258c1184afa1457", "Star Fox 64 (U) (V1.0)" },
@@ -21,7 +23,7 @@ std::unordered_map<std::string, std::string> mGameList = {
};
bool GameExtractor::SelectGameFromUI() {
#if !defined(__IOS__) || !defined(__ANDROID__) || !defined(__SWITCH__)
#if !defined(__IOS__) && !defined(__ANDROID__) && !defined(__SWITCH__)
auto selection = pfd::open_file("Select a file", ".", { "N64 Roms", "*.z64" }).result();
if (selection.empty()) {
+16 -11
View File
@@ -14,6 +14,11 @@
#include "port/notification/notification.h"
#include "utils/StringHelper.h"
#ifdef __SWITCH__
#include <port/switch/SwitchImpl.h>
#include <port/switch/SwitchPerformanceProfiles.h>
#endif
extern "C" {
#include "sys.h"
#include <sf64audio_provisional.h>
@@ -192,20 +197,10 @@ void DrawSettingsMenu(){
UIWidgets::Spacer(0);
#ifndef __SWITCH__
UIWidgets::CVarCheckbox("Menubar Controller Navigation", "gControlNav", {
.tooltip = "Allows controller navigation of the SOH menu bar (Settings, Enhancements,...)\nCAUTION: This will disable game inputs while the menubar is visible.\n\nD-pad to move between items, A to select, and X to grab focus on the menu bar"
});
#endif
// UIWidgets::CVarCheckbox("Show Inputs", "gInputEnabled", {
// .tooltip = "Shows currently pressed inputs on the bottom right of the screen"
// });
if (CVarGetInteger("gInputEnabled", 0)) {
UIWidgets::CVarSliderFloat("Input Scale", "gInputScale", 1.0f, 3.0f, 1.0f, {
.tooltip = "Sets the on screen size of the displayed inputs from the Show Inputs setting",
.format = "%.1fx",
});
}
UIWidgets::CVarCheckbox("Invert Y Axis", "gInvertYAxis",{
.tooltip = "Inverts the Y axis for controlling vehicles"
});
@@ -648,6 +643,16 @@ void DrawDebugMenu() {
Ship::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1));
}
#ifdef __SWITCH__
if (UIWidgets::CVarCombobox("Switch CPU Profile", "gSwitchPerfMode", SWITCH_CPU_PROFILES, {
.tooltip = "Switches the CPU profile to a different one",
.defaultIndex = (int)Ship::SwitchProfiles::STOCK
})) {
SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger("gSwitchPerfMode", (int)Ship::SwitchProfiles::STOCK)]);
Ship::Switch::ApplyOverclock();
}
#endif
UIWidgets::WindowButton("Gfx Debugger", "gGfxDebuggerEnabled", GameUI::mGfxDebuggerWindow, {
.tooltip = "Enables the Gfx Debugger window, allowing you to input commands, type help for some examples"
});