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

feat: allow creating uninitialized context #340

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

briaguya-ai
Copy link
Collaborator

@briaguya-ai briaguya-ai commented Sep 13, 2023

example switch to allow cvar use before full init in SoH

Before

context = LUS::Context::CreateInstance("Ship of Harkinian", appShortName, "shipofharkinian.json", OTRFiles, {}, 3);

After

// init just what we need
context = LUS::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json");
context->InitLogging();
context->InitConfiguration();
context->InitConsoleVariables();

// prove we can get a value from a cvar now
int blarg = CVarGetInteger("gInterpolationFPS", 3);

// finish up the init
context->Init(OTRFiles, {}, 3);

@Kenix3 Kenix3 merged commit 883fb45 into Kenix3:main Sep 13, 2023
4 checks passed
@briaguya-ai briaguya-ai mentioned this pull request Sep 21, 2023
@briaguya-ai briaguya-ai deleted the create-uninitialized-context branch November 19, 2023 21:30
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

Successfully merging this pull request may close these issues.

2 participants