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

Boot rework #719

Merged
merged 15 commits into from
Dec 1, 2023
Merged

Boot rework #719

merged 15 commits into from
Dec 1, 2023

Conversation

bjornbytes
Copy link
Owner

@bjornbytes bjornbytes commented Nov 5, 2023

This is a complete overhaul of the startup process for LÖVR! Some of the build system stuff isn't finished yet, but in the meantime I'm gonna write about it here since the design is somewhat stable.

The key points are:

  • The nogame screen is distributed as a fused zip instead of being embedded in the C code.
  • All CLI behavior is moved into a new file, arg.lua. This is also in the fused zip. It handles all argument parsing, including finding the project passed in on the command line, --help/--version, etc.

The impact of these changes are:

  • The nogame screen and argument handling can be removed entirely when creating a fused project. This makes projects a little bit smaller and allows the nogame screen and CLI to be as big as they want without bloating every shipped app.
  • Fused projects will no longer respond to lovr's development CLI arguments. It wasn't a huge deal, but it always kinda bothered me that you could do game.exe --help and see a weird message about lovr.
  • Because LÖVR will always be a zip, and that zip will always be mounted, you can do some interesting things:
    • You can edit the nogame screen.
    • You can add your own CLI behavior, and it will work for every app.
    • You can add libraries to the zip and use them in any project (!)

@bjornbytes
Copy link
Owner Author

This is confirmed working on Windows and Linux. macOS will probably need special handling for LOVR_BUILD_BUNDLED=ON builds, Android will definitely need special handling but it might be as simple as defaulting ANDROID_ASSETS to the etc/nogame folder and skipping the regular nogame exe packaging.

@bjornbytes bjornbytes force-pushed the boot-rework branch 2 times, most recently from 8e231c3 to d5f0724 Compare November 27, 2023 06:09
@bjornbytes
Copy link
Owner Author

Ok, macOS and Android work as well now!

There might be one issue where the nogame's conf.lua affects projects that are missing a conf.lua of their own, need to test that but otherwise this is probably ready to merge?

@bjornbytes bjornbytes merged commit 4da1f26 into dev Dec 1, 2023
8 checks passed
@bjornbytes bjornbytes deleted the boot-rework branch December 1, 2023 08:29
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.

1 participant