Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix init issues #775

Open
briaguya-ai opened this issue Dec 26, 2024 · 0 comments
Open

fix init issues #775

briaguya-ai opened this issue Dec 26, 2024 · 0 comments

Comments

@briaguya-ai
Copy link
Collaborator

briaguya-ai commented Dec 26, 2024

some constructors expect things to be initialized which is breaking the ability to call

Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 44100, 1024*2, 2480*2 }, window, controlDeck);

from HarbourMasters/Starship#74

+ this->context =
+     Ship::Context::CreateUninitializedInstance("Starship", "ship", "starship.cfg.json");
+
+ 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); // 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 =
-     Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 44100, 1024*2, 2480*2 }, window, controlDeck);
+ this->context->Init(OTRFiles, {}, 3, { 44100, 1024*2, 2480*2 }, window, controlDeck);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant