summaryrefslogtreecommitdiff
path: root/src/port/Engine.cpp
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2024-12-26 14:12:42 -0500
committerLywx <kiritodev01@gmail.com>2024-12-26 14:17:32 -0600
commita307375968d36a277f67a712f1d072f460e1ac7d (patch)
treedc2d0dd3d1481a69b0b7e474c81ca6a2e9913b5f /src/port/Engine.cpp
parent26a8d3925b3fabcc8d71dd37a3b03fe42d10953f (diff)
cleaner workaround with comments
Diffstat (limited to 'src/port/Engine.cpp')
-rw-r--r--src/port/Engine.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp
index 79eafd19..200eb46c 100644
--- a/src/port/Engine.cpp
+++ b/src/port/Engine.cpp
@@ -82,27 +82,19 @@ GameEngine::GameEngine() {
}
}
-
this->context =
Ship::Context::CreateUninitializedInstance("Starship", "ship", "starship.cfg.json");
-
- this->context->InitLogging();
- this->context->InitConfiguration();
- this->context->InitConsoleVariables();
+
+ this->context->InitConfiguration(); // without this line InitConsoleVariables fails at Config::Reload()
+ this->context->InitConsoleVariables(); // without this line the controldeck constructor failes in ShipDeviceIndexMappingManager::UpdateControllerNamesFromConfig()
auto controlDeck = std::make_shared<LUS::ControlDeck>();
- this->context->InitResourceManager(OTRFiles, {}, 3);
- this->context->InitControlDeck(controlDeck);
- this->context->InitCrashHandler();
- this->context->InitConsole();
+ this->context->InitResourceManager(OTRFiles, {}, 3); // without this line InitWindow fails in Gui::Init()
+ this->context->InitConsole(); // without this line the GuiWindow constructor fails in ConsoleWindow::InitElement()
auto window = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({}));
- this->context->InitWindow(window);
- this->context->InitAudio({ 44100, 1024*2, 2480*2 });
- this->context->InitGfxDebugger();
-
this->context->Init(OTRFiles, {}, 3, { 44100, 1024*2, 2480*2 }, window, controlDeck);
Ship::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1));