Skip to content

Commit 814efd7

Browse files
committed
Even more small fixes
1 parent c1971cd commit 814efd7

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

src/port/Engine.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
#include "controller/controldeck/ControlDeck.h"
4747
#include "port/mods/utils/GfxPrint.h"
4848

49-
#ifdef __SWITCH__
50-
#include <port/switch/SwitchImpl.h>
51-
#endif
52-
5349
const float imguiScaleOptionToValue[4] = { 0.75f, 1.0f, 1.5f, 2.0f };
5450
std::shared_ptr<Fast::Fast3dWindow> gsFast3dWindow;
5551
const uint32_t defaultImGuiScale = 1;
@@ -122,11 +118,6 @@ bool VerifyArchiveVersion(OTRVersion version) {
122118
GameEngine::GameEngine() : dictionary(nullptr) {
123119
this->context = Ship::Context::CreateUninitializedInstance("Ghostship", "sm64", "ghostship.cfg.json");
124120

125-
#ifdef __SWITCH__
126-
Ship::Switch::Init(Ship::PreInitPhase);
127-
Ship::Switch::Init(Ship::PostInitPhase);
128-
#endif
129-
130121
this->context->InitConfiguration(); // without this line InitConsoleVariables fails at Config::Reload()
131122
this->context->InitConsoleVariables(); // without this line the controldeck constructor failes in
132123
// ShipDeviceIndexMappingManager::UpdateControllerNamesFromConfig()
@@ -173,7 +164,9 @@ GameEngine::GameEngine() : dictionary(nullptr) {
173164
archiveFiles.push_back(assets_path);
174165
}
175166

176-
if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods"); !patches_path.empty()) {
167+
const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods");
168+
169+
if (!patches_path.empty()) {
177170
if (!std::filesystem::exists(patches_path)) {
178171
std::filesystem::create_directories(patches_path);
179172
}
@@ -190,6 +183,13 @@ GameEngine::GameEngine() : dictionary(nullptr) {
190183
archiveFiles.push_back(p.path().generic_string());
191184
}
192185
}
186+
187+
for (const auto& p : std::filesystem::directory_iterator(patches_path)) {
188+
if(p.is_directory()){
189+
SPDLOG_INFO("Found mod directory: {}", p.path().generic_string());
190+
archiveFiles.push_back(p.path().generic_string());
191+
}
192+
}
193193
}
194194
}
195195

@@ -421,9 +421,6 @@ void GameEngine::Destroy() {
421421
gsFast3dWindow = nullptr;
422422
Instance->context = nullptr;
423423
AudioExit();
424-
#ifdef __SWITCH__
425-
Ship::Switch::Exit();
426-
#endif
427424
}
428425

429426
void GameEngine::StartFrame() const {

src/port/ui/GhostshipGui.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#include <fast/backends/gfx_metal.h>
99
#endif
1010

11-
#ifdef __SWITCH__
12-
#include <port/switch/SwitchImpl.h>
13-
#endif
14-
1511
#include "Notification.h"
1612
#include "GhostshipInputEditorWindow.h"
1713
#include "SaveEditor.h"

0 commit comments

Comments
 (0)