This class contains the engine's configuration read either from the config file or from the command line.
More...
#include <prefs.h>
This class contains the engine's configuration read either from the config file or from the command line.
Definition at line 74 of file prefs.h.
§ config()
Constructor.
Initializes all configuration options with default values.
- Language: English
- Screen mode: windowed
- Quick load: enabled
- Audio: High quality (44.1kHz, 16 bit, stereo)
- Volume: 100%
- Config file: $HOME/.adonthell/adonthellrc
Definition at line 36 of file prefs.cc.
§ parse_arguments()
void config::parse_arguments |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
See whether any options have been specified on the command line.
Possible command line options are
- -h Print help message
- -d Print the data directory
- -v Print the version number
- -l List games found in the gamedir
- -g dir Play game contained in dir
- -c Byte-compile all Python scripts in the current directory
- Parameters
-
argc | argument count |
argv | argument vector |
Definition at line 106 of file prefs.cc.
§ write_adonthellrc()
void config::write_adonthellrc |
( |
| ) |
|
Writes a default configuration file with the values set in the constructor.
- See also
- config::config ()
Definition at line 253 of file prefs.cc.
§ read_adonthellrc()
bool config::read_adonthellrc |
( |
| ) |
|
Reads the configuration file.
If it cannot find the file, it tries to write a default one.
- Returns
- true on success, false otherwise.
Definition at line 290 of file prefs.cc.
§ get_adonthellrc()
char * config::get_adonthellrc |
( |
| ) |
|
Returns the path to the user's private Adonthell directory.
Usually this is $HOME/.adonthell/ and will contain his personal configuration as well as all saved games.
Definition at line 247 of file prefs.cc.
§ language
Language to use if NLS was compiled in.
Definition at line 130 of file prefs.h.
§ game_name
Name of the game that is running at present.
Definition at line 135 of file prefs.h.
§ gamedir
Path of the directory that contains the game running at present.
Definition at line 139 of file prefs.h.
§ screen_mode
Whether the engine shall run in window (0) or fullscreen (1) mode.
Definition at line 143 of file prefs.h.
§ display
Index of the display to use for fullscreen mode.
Definition at line 147 of file prefs.h.
§ quick_load
Whether the quick-load feature is enabled (1) or not (0)
Definition at line 151 of file prefs.h.
§ audio_channels
The number of channels: mono (0) or stereo (1).
Definition at line 155 of file prefs.h.
§ audio_resolution
u_int8 config::audio_resolution |
The resolution: 8 bit (0) or 16 bit (1)
Definition at line 159 of file prefs.h.
§ audio_sample_rate
u_int8 config::audio_sample_rate |
The sample rate: 11025 Hz (0), 22050 Hz (1) or 44100 Hz (2)
Definition at line 163 of file prefs.h.
§ audio_volume
The volume: a value betwen 0 and 100.
0 means that audio is completely off.
Definition at line 168 of file prefs.h.
The documentation for this class was generated from the following files: