naev 0.11.5
conf.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include <time.h>
7
8#define CONF_FILE "conf.lua"
13/* Gameplay options */
14#define DOUBLETAP_SENSITIVITY_DEFAULT 250
15#define REDIRECT_FILE_DEFAULT 1
16#define SAVE_COMPRESSION_DEFAULT 1
17#define MOUSE_HIDE_DEFAULT 3.
18#define MOUSE_FLY_DEFAULT 1
19#define MOUSE_ACCEL_DEFAULT 1
20#define MOUSE_DOUBLECLICK_TIME 0.5
21#define MANUAL_ZOOM_DEFAULT 0
22#define ZOOM_FAR_DEFAULT 0.5
23#define ZOOM_NEAR_DEFAULT 1.0
24#define ZOOM_SPEED_DEFAULT 0.25
25#define MAP_OVERLAY_OPACITY_DEFAULT 0.3
26#define INPUT_MESSAGES_DEFAULT 5
27#define DIFFICULTY_DEFAULT NULL
28/* Video options */
29#define RESOLUTION_W_MIN 1280
30#define RESOLUTION_H_MIN 720
31#define RESOLUTION_W_DEFAULT RESOLUTION_W_MIN
32#define RESOLUTION_H_DEFAULT RESOLUTION_H_MIN
33#define FULLSCREEN_DEFAULT 0
34#define FULLSCREEN_MODESETTING 0
35#define FSAA_DEFAULT 1
36#define VSYNC_DEFAULT 0
37#define SCALE_FACTOR_DEFAULT 1.
38#define NEBULA_SCALE_FACTOR_DEFAULT 4.
39#define SHOW_FPS_DEFAULT 0
40#define FPS_MAX_DEFAULT 60
41#define SHOW_PAUSE_DEFAULT 1
42#define MINIMIZE_DEFAULT 1
43#define COLORBLIND_DEFAULT 0
44#define HEALTHBARS_DEFAULT 1
45#define BG_BRIGHTNESS_DEFAULT 0.5
46#define NEBU_NONUNIFORMITY_DEFAULT 1.
47#define GAMMA_CORRECTION_DEFAULT 1.
48#define BACKGROUND_FANCY_DEFAULT 0
49#define JUMP_BRIGHTNESS_DEFAULT 1.
50#define BIG_ICONS_DEFAULT 0
51#define FONT_SIZE_CONSOLE_DEFAULT 10
52#define FONT_SIZE_INTRO_DEFAULT 18
53#define FONT_SIZE_DEF_DEFAULT 12
54#define FONT_SIZE_SMALL_DEFAULT 11
55/* Audio options */
56#define USE_EFX_DEFAULT 1
57#define MUTE_SOUND_DEFAULT 0
58#define SOUND_VOLUME_DEFAULT 0.6
59#define MUSIC_VOLUME_DEFAULT 0.8
60#define ENGINE_VOLUME_DEFAULT 0.8
61/* Editor Options */
62#define DEV_SAVE_SYSTEM_DEFAULT "../dat/ssys/"
63#define DEV_SAVE_SPOB_DEFAULT "../dat/spob/"
64#define DEV_SAVE_MAP_DEFAULT "../dat/outfits/maps/"
65
71typedef struct PlayerConf_s {
72 int loaded;
74 /* ndata. */
75 char *ndata;
76 char *datapath;
78 /* Language. */
79 char *language;
81 /* OpenGL properties. */
82 int fsaa;
83 int vsync;
85 /* Video options. */
86 int width;
87 int height;
89 double scalefactor;
90 double nebu_scale;
104 /* Sound. */
105 int al_efx;
107 double sound;
108 double music;
109 double engine_vol;
111 /* FPS. */
115 /* Pause. */
118 /* Joystick. */
122 /* GUI. */
128 /* Keyrepeat. */
129 unsigned int repeat_delay;
130 unsigned int repeat_freq;
132 /* Zoom. */
134 double zoom_far;
135 double zoom_near;
136 double zoom_speed;
138 /* Font sizes. */
144 /* Misc. */
150 unsigned int doubletap_sens;
151 double mouse_hide;
161 int nosave;
164 time_t last_played;
166 /* Debugging. */
169 /* Editor. */
174extern PlayerConf_t conf;
176/*
177 * loading
178 */
179void conf_setDefaults (void);
180void conf_setGameplayDefaults (void);
181void conf_setAudioDefaults (void);
182void conf_setVideoDefaults (void);
183void conf_loadConfigPath( void );
184int conf_loadConfig( const char* file );
185void conf_parseCLI( int argc, char** argv );
186void conf_cleanup (void);
187
188/*
189 * Some handling.
190 */
191void conf_copy( PlayerConf_t *dest, const PlayerConf_t *src );
192void conf_free( PlayerConf_t *config );
193
194/*
195 * saving
196 */
197int conf_saveConfig( const char* file );
Struct containing player options.
Definition conf.h:71
double jump_brightness
Definition conf.h:100
int lua_repl
Definition conf.h:160
int always_radar
Definition conf.h:126
int nosound
Definition conf.h:106
double engine_vol
Definition conf.h:109
double scalefactor
Definition conf.h:89
int healthbars
Definition conf.h:97
char * dev_save_map
Definition conf.h:171
int font_size_def
Definition conf.h:141
double autonav_reset_shield
Definition conf.h:156
char * datapath
Definition conf.h:76
int colourblind
Definition conf.h:96
int fullscreen
Definition conf.h:91
int vsync
Definition conf.h:83
double compression_velocity
Definition conf.h:146
int modesetting
Definition conf.h:92
int fps_max
Definition conf.h:113
int width
Definition conf.h:86
time_t last_played
Definition conf.h:164
double zoom_speed
Definition conf.h:136
int minimize
Definition conf.h:95
int font_size_small
Definition conf.h:142
char * language
Definition conf.h:79
int devmode
Definition conf.h:157
int pause_show
Definition conf.h:116
int mouse_accel
Definition conf.h:153
int height
Definition conf.h:87
int loaded
Definition conf.h:72
double mouse_hide
Definition conf.h:151
int notresizable
Definition conf.h:93
int big_icons
Definition conf.h:125
unsigned int repeat_freq
Definition conf.h:130
double music
Definition conf.h:108
double mouse_doubleclick
Definition conf.h:154
char * ndata
Definition conf.h:75
double autonav_reset_dist
Definition conf.h:155
int devautosave
Definition conf.h:158
int al_efx
Definition conf.h:105
unsigned int repeat_delay
Definition conf.h:129
char * difficulty
Definition conf.h:145
double compression_mult
Definition conf.h:147
int background_fancy
Definition conf.h:102
int fps_show
Definition conf.h:112
int mesg_visible
Definition conf.h:123
double sound
Definition conf.h:107
double zoom_far
Definition conf.h:134
double gamma_correction
Definition conf.h:101
int explicit_dim
Definition conf.h:88
int nosave
Definition conf.h:161
unsigned int doubletap_sens
Definition conf.h:150
int lua_enet
Definition conf.h:159
double bg_brightness
Definition conf.h:98
int font_size_console
Definition conf.h:139
int zoom_manual
Definition conf.h:133
int save_compress
Definition conf.h:149
int redirect_file
Definition conf.h:148
double map_overlay_opacity
Definition conf.h:124
double nebu_scale
Definition conf.h:90
char * dev_save_spob
Definition conf.h:172
int mouse_fly
Definition conf.h:152
double nebu_nonuniformity
Definition conf.h:99
double zoom_near
Definition conf.h:135
char * lastversion
Definition conf.h:162
int translation_warning_seen
Definition conf.h:163
int fsaa
Definition conf.h:82
int fpu_except
Definition conf.h:167
int borderless
Definition conf.h:94
int font_size_intro
Definition conf.h:140
int joystick_ind
Definition conf.h:119
char * dev_save_sys
Definition conf.h:170
char * joystick_nam
Definition conf.h:120