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 support for mount priority #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

criptych
Copy link

@criptych criptych commented Jul 2, 2021

This allows limited manipulation of the search path without unmounting/remounting to get mounts in the right order.

It makes negligible changes to the API, repurposing the existing "appendToPath" parameter to PHYSFS_mount* and handling typical "flag" values (0, 1, -1) in such a way that current programs should have no change in function. An int is added to each DirHandle to store the mount's priority for later comparison.

I had a use case in mind when I initially wrote this, but the specifics are lost to memory (that was almost 3 years ago). Something that comes to mind is dynamically mounted DLC and UGC: one might mount UGC at a high priority (say 5), so that it overrides DLC at priority 10, which in turn overrides base content at priority 20. If a new DLC package is mounted mid-game, also at priority 10, it won't inadvertently override mounted UGC.

@criptych criptych marked this pull request as ready for review July 4, 2021 02:20
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