Add optional monolithic pakfile-based filesystem #234
Merged
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.
Description
Adds ability to read files from pak files while also maintaining typical file system reads. Also introduces
pak_tool
executable andpackDirectory()
convenience CMake function to generate those files.Closes #50
Motivation and Context
This is crucial for floppy-based productions since Amiga file systems add their bloat when using a lot of small files. Having all of them condensed into a single one skips this overhead and allows for storing more data.
This also paves way for adding custom file handlers and implementing trackloaders as well as reading from virtual files stored in memory - thus
bitmapLoadFromMemory()
and similar functions are no longer needed.It's also possible to add compression algorithms to the pak file and mark file as compressed (at all or with given algorithm) in pak file's table of contents.
The pak file structure is loosely based on Lost Vikings / Soul Reaver data files.
How Has This Been Tested?
Used in Battle Squadron 2 for AmiGameJam 2024.
Types of changes
All functions which would open a file now accept opened file descriptor instead of file path - e.g.
bitmapCreateFromFile()
- in this example it is renamed tobitmapCreateFromPath()
and thebitmapCreateFromFd()
counterpart was introduced.Checklist