Check if a configuration file named exactly like the device exists in the /mappings/ directory.
If it does, use this instead of the generic one.
Expose file_exists() from stdclass.
Since EvdevControllerMapping does not have a default constructor,
we can't use the operator[];
data_type& operator[](const key_type& k) - Returns a reference to
the object that is associated with a particular key. If the map
does not already contain such an object, operator[] inserts the
default object data_type().
Instead, we use the std::map.find() function.
This should resolve#971.
I tried running reicast and it immediately died with:
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Aborted
I was missing the environment variable XDG_CONFIG_DIRS
Turns out find_system_config_dirs() checked for the existence of
XDG_DATA_DIRS but then tried to use XDG_CONFIG_DIRS (non-existent in my
case).
fixes#847
- Fix RECT fields oder (initialized via {} on the code)
- Initialize shuffle_alpha (duh ...)
- X11 Image drawing (hacky, depends on internal X11 details)
- Untwidle code w/ optional flipping (X11 doesn't use inverted bitmaps)
- rgba shuffling (not needed yet, but left for documentation)
This adds support for separate config and data dirs.
On Linux, these will be compliant XDG Basedir Specification, i.e.
XDG_CONFIG_HOME and XDG_CONFIG_DIRS (or XDG_DATA_HOME and XDG_DATA_DIRS
respectively). On all other platforms, there currently just set to the
homedir path (so no previous behaviour has been changed).
If reicast wants to read and write a data file, it just calls
get_data_path("/samplefile.txt"). If it does not need to write to
that file, it just uses get_data_path("/samplefile.txt", false). That
way, we can also use system-wide dirs (like /usr/share/reicast on
linux), that the user usually doesn't have write access to.
The same applies for config file, where you use get_config_path(args)
respectively.
This coommit makes reicast use $XDG_CONFIG_HOME from XDG Base Directory
Specification[1] if possible.
For backwards-compatability with older installations, it checks if the
old-style config directory at $HOME/.reicast exists. If so, it'll use
that instead.
All new installation should use $XDG_CONFIG_HOME/reicast (or if
that environment variable is not set: $HOME/.config/reicast).
[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html