NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 140 forks source link

Enable more paths for game loading, saving & storing the configuration for *NIX envs #303

Closed twojstaryzdomu closed 1 year ago

twojstaryzdomu commented 1 year ago

The current file path scheme is inherited from DOS, where all the files resided in a single directory. In order to enable packaging the game for *NIX environments, the game shouldn't be restricted to reading the game files, save files or the configuration from the directory with the binary.

The search order for reading files is home directory (~/.SDLPoP) first, data directory (/usr/share/SDLPoP) and executable directory last. Saving the game or the configuration occurs into a directory found in the same order, with the first user-accessible directory is used.

Nothing is changed for WIN-based environments.