diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2024-12-26 13:59:26 -0500 |
|---|---|---|
| committer | Lywx <kiritodev01@gmail.com> | 2024-12-26 14:17:32 -0600 |
| commit | 26a8d3925b3fabcc8d71dd37a3b03fe42d10953f (patch) | |
| tree | ffae1a9665c1143e8279fc456c1b8dfc7a9bac9c | |
| parent | 20f8d8d96a5ebbdb17564ee7b0adb479772468a2 (diff) | |
manually init LUS to workaround init dependency issues in constructors
| -rw-r--r-- | src/port/Engine.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 40f8d083..79eafd19 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -82,11 +82,28 @@ GameEngine::GameEngine() { } } + + this->context = + Ship::Context::CreateUninitializedInstance("Starship", "ship", "starship.cfg.json"); + + this->context->InitLogging(); + this->context->InitConfiguration(); + this->context->InitConsoleVariables(); + auto controlDeck = std::make_shared<LUS::ControlDeck>(); + + this->context->InitResourceManager(OTRFiles, {}, 3); + this->context->InitControlDeck(controlDeck); + this->context->InitCrashHandler(); + this->context->InitConsole(); + auto window = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({})); - this->context = - Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 44100, 1024*2, 2480*2 }, window, controlDeck); + 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)); Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v"); |
