Persistent storage for global configuration
This one superseds #53
The game browser would make a bit more sense when you could browse (or auto scan as planned for Android) your hard disk and add game directories. The game directories must be remembered.
This needs changes to the FileFinder:
- [x] CreateDirectory function
- [ ] GetConfigDirectory function
- [ ] GetConfigFile function
CreateDirectory: As the name says
GetConfigDirectory: Create path to config directory if non existant and return a DirectoryTree handle to it. SDL2 has a function for this (can't remember the name). The code could be used as a reference because I don't want a SDL2 dependency.
GetConfigFile: Return path to config file in config directory. Format to be decided, probably INI or JSON (picojson header)
Could probably also store other things in this file like button mappings (joystick), but that's not subject of this issue
[GameDirectories]
LastDirectory=
Folder1=
Folder2=
...
Folder9=
{
"last_directory": "",
"game_directories" : ["folder1", "folder2"]
}
https://github.com/Malvineous/cfgpath could be used in parts too.
Once the VFS-stuff is in I will take a look at this. Will be also useful for savegame redirection (save in APPDATA when the game dir is not writable). Also a requested feature for libretro