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

Add optional monolithic pakfile-based filesystem #234

Merged
merged 12 commits into from
Dec 13, 2024
Merged

Conversation

tehKaiN
Copy link
Member

@tehKaiN tehKaiN commented Dec 10, 2024

Description

Adds ability to read files from pak files while also maintaining typical file system reads. Also introduces pak_tool executable and packDirectory() 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

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 to bitmapCreateFromPath() and the bitmapCreateFromFd() counterpart was introduced.

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@tehKaiN tehKaiN merged commit f646d00 into master Dec 13, 2024
2 checks passed
@tehKaiN tehKaiN deleted the filesystem-callbacks branch December 13, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for virtual filesystem in monolithic file
1 participant