Summary
Add an InitPhysFSAuto() (or similar) helper that automatically searches for and mounts a default archive without the caller having to figure out the path. This mirrors the convention used by LÖVE, SDL-based games, and several other engines, and removes a chunk of boilerplate from typical raylib game startup code.
Proposed behavior
Given a filename like "data.zip", search in this order and mount the first hit:
- Next to the running executable (use raylib's
GetApplicationDirectory()).
- The current working directory.
- A loose folder of the same base name (e.g.
data/) for development builds where assets aren't packed yet.
If none are found, return false and let the caller decide what to do.
Proposed API
bool InitPhysFSAuto(const char* archiveName, const char* mountPoint);
archiveName — e.g. "data.zip". May be NULL to fall back to a default.
mountPoint — passed through to PhysFS, may be NULL for root.
Why
- Removes the most common ~10 lines of "figure out where my assets live" code from every project that uses this library.
- Makes "ship a single executable + zip" workflows trivial.
- Keeps dev-mode (loose folder) and release-mode (zip) using the same code path.
Notes
- Should respect
RAYLIB_PHYSFS_PLATFORM_RAYLIB so it works on platforms where raylib provides its own file I/O.
- Consider also exposing the resolved path via an out-parameter for logging.
Summary
Add an
InitPhysFSAuto()(or similar) helper that automatically searches for and mounts a default archive without the caller having to figure out the path. This mirrors the convention used by LÖVE, SDL-based games, and several other engines, and removes a chunk of boilerplate from typical raylib game startup code.Proposed behavior
Given a filename like
"data.zip", search in this order and mount the first hit:GetApplicationDirectory()).data/) for development builds where assets aren't packed yet.If none are found, return
falseand let the caller decide what to do.Proposed API
archiveName— e.g."data.zip". May beNULLto fall back to a default.mountPoint— passed through to PhysFS, may beNULLfor root.Why
Notes
RAYLIB_PHYSFS_PLATFORM_RAYLIBso it works on platforms where raylib provides its own file I/O.