Main: Fixup bogus fallback to project manager with more bolognese #49661
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WARNING: Hacks everywhere!
The logic in
main.cpp
is due a full rewrite as it's extremely hacky,splitting argument parsing over several functions, with a mess of global state
and assumptions about what combinations of arguments or lack thereof should
mean in terms of what we want to read: game, editor, project manager, or
command line tools such as
--doctool
,--export
or--script
.Until this is fully rewritten, this patch hacks things some more to ensure
that we don't fall back to the project manager in cases where it's not
warranted, and especially not too late, as it can mean that we haven't
properly initialized stuff like
EditorPaths
needed by the PM (which in turnimpacts what kind of path will be used for logs and the shader cache, etc...
the rabbit hole goes deep).
Fixes #41435.
Fixes #49392.
Fixes #49658.
Fixes #38202 (comment).
This has a lot of potential for regressions as this code is really brittle, and my preferred approach to making things better (and fixing potential regressions) would be to rewrite the whole thing from scratch, which I might do soon, after reviewing some pending PRs which tried to poke at this mess.