naev 0.12.6
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"
9
13/* Gameplay options */
14#define DOUBLETAP_SENSITIVITY_DEFAULT \
15 250
16#define REDIRECT_FILE_DEFAULT \
17 1
18#define MOUSE_HIDE_DEFAULT \
19 3.
20#define MOUSE_FLY_DEFAULT \
21 1
22#define MOUSE_ACCEL_DEFAULT \
23 1
24#define MOUSE_DOUBLECLICK_TIME \
25 0.5
26#define MANUAL_ZOOM_DEFAULT \
27 0
28#define ZOOM_FAR_DEFAULT 0.5
29#define ZOOM_NEAR_DEFAULT 1.0
30#define ZOOM_SPEED_DEFAULT \
31 0.25
32#define MAP_OVERLAY_OPACITY_DEFAULT \
33 0.3
34#define INPUT_MESSAGES_DEFAULT 5
35#define DIFFICULTY_DEFAULT NULL
36/* Video options */
37#define RESOLUTION_W_MIN \
38 1280
39#define RESOLUTION_H_MIN \
40 720
41#define RESOLUTION_W_DEFAULT RESOLUTION_W_MIN
42#define RESOLUTION_H_DEFAULT RESOLUTION_H_MIN
43#define FULLSCREEN_DEFAULT 0
44#define FULLSCREEN_MODESETTING \
45 0
46#define FSAA_DEFAULT 1
47#define VSYNC_DEFAULT 0
48#define SCALE_FACTOR_DEFAULT 1.
49#define NEBULA_SCALE_FACTOR_DEFAULT \
50 4.
51#define SHOW_FPS_DEFAULT 0
52#define FPS_MAX_DEFAULT 60
53#define SHOW_PAUSE_DEFAULT 1
54#define MINIMIZE_DEFAULT 1
55#define COLOURBLIND_SIM_DEFAULT \
56 0.
57#define COLOURBLIND_TYPE_DEFAULT \
58 0
60#define COLOURBLIND_CORRECT_DEFAULT \
61 0.
62#define GAME_SPEED_DEFAULT 1.
63#define HEALTHBARS_DEFAULT 1
64#define BG_BRIGHTNESS_DEFAULT \
65 0.5
66#define NEBU_NONUNIFORMITY_DEFAULT \
67 1.
68#define NEBU_SATURATION_DEFAULT \
69 0.9
70#define PUZZLE_SKIP_DEFAULT \
71 0
73#define GAMMA_CORRECTION_DEFAULT 1.
74#define JUMP_BRIGHTNESS_DEFAULT 0.8
75#define BIG_ICONS_DEFAULT 0
76#define FONT_SIZE_CONSOLE_DEFAULT 10
77#define FONT_SIZE_INTRO_DEFAULT 18
78#define FONT_SIZE_DEF_DEFAULT 12
79#define FONT_SIZE_SMALL_DEFAULT 11
80#define LOW_MEMORY_DEFAULT 0
81#define MAX_3D_TEX_SIZE 256
82/* Audio options */
83#define USE_EFX_DEFAULT 1
84#define MUTE_SOUND_DEFAULT 0
85#define SOUND_VOLUME_DEFAULT 0.7
86#define MUSIC_VOLUME_DEFAULT 0.8
87#define ENGINE_VOLUME_DEFAULT 0.8
88
94typedef struct PlayerConf_s {
95 int
97
98 /* ndata. */
99 char *ndata;
100 char *datapath;
101
102 /* Language. */
103 char *language;
104
105 /* OpenGL properties. */
106 int fsaa;
107 int vsync;
108
109 /* Video options. */
110 int width;
111 int height;
113 double scalefactor;
114 double nebu_scale;
123 double
125 double game_speed;
136
137 /* Sound. */
138 int
141 double sound;
142 double music;
143 double engine_vol;
144
145 /* FPS. */
148
149 /* Pause. */
151
152 /* Joystick. */
155
156 /* GUI. */
161
162 /* Keyrepeat. */
163 unsigned int repeat_delay;
164 unsigned int repeat_freq;
166
167 /* Zoom. */
169 double zoom_far;
171 double zoom_near;
172 double zoom_speed;
173
174 /* Font sizes. */
179
180 /* Misc. */
185 unsigned int doubletap_sens;
187 double mouse_hide;
199 int nosave;
203 time_t last_played;
204
205 /* Debugging. */
207
208 /* Editor. */
211extern PlayerConf_t conf;
212
213/*
214 * loading
215 */
216void conf_setDefaults( void );
217void conf_setGameplayDefaults( void );
218void conf_setAudioDefaults( void );
219void conf_setVideoDefaults( void );
220void conf_loadConfigPath( void );
221int conf_loadConfig( const char *file );
222int conf_parseCLI( int argc, char **argv );
223void conf_cleanup( void );
224
225/*
226 * Some handling.
227 */
228void conf_copy( PlayerConf_t *dest, const PlayerConf_t *src );
229void conf_free( PlayerConf_t *config );
230
231/*
232 * saving
233 */
234int conf_saveConfig( const char *file );
Struct containing player options.
Definition conf.h:94
double jump_brightness
Definition conf.h:130
int lua_repl
Definition conf.h:198
double nebu_saturation
Definition conf.h:129
int always_radar
Definition conf.h:160
int nosound
Definition conf.h:140
double engine_vol
Definition conf.h:143
double scalefactor
Definition conf.h:113
int max_3d_tex_size
Definition conf.h:134
double colourblind_correct
Definition conf.h:124
int healthbars
Definition conf.h:126
int font_size_def
Definition conf.h:177
int puzzle_skip
Definition conf.h:131
double game_speed
Definition conf.h:125
double autonav_reset_shield
Definition conf.h:193
char * datapath
Definition conf.h:100
int fullscreen
Definition conf.h:116
int vsync
Definition conf.h:107
double compression_velocity
Definition conf.h:182
int modesetting
Definition conf.h:117
int fps_max
Definition conf.h:147
int width
Definition conf.h:110
time_t last_played
Definition conf.h:203
double zoom_speed
Definition conf.h:172
int minimize
Definition conf.h:120
int font_size_small
Definition conf.h:178
char * language
Definition conf.h:103
int devmode
Definition conf.h:195
int pause_show
Definition conf.h:150
int mouse_accel
Definition conf.h:189
double colourblind_sim
Definition conf.h:121
int height
Definition conf.h:111
int loaded
Definition conf.h:96
double mouse_hide
Definition conf.h:187
int notresizable
Definition conf.h:118
int colourblind_type
Definition conf.h:122
int big_icons
Definition conf.h:159
unsigned int repeat_freq
Definition conf.h:164
double music
Definition conf.h:142
double mouse_doubleclick
Definition conf.h:190
char * ndata
Definition conf.h:99
double autonav_reset_dist
Definition conf.h:191
int devautosave
Definition conf.h:196
int al_efx
Definition conf.h:139
unsigned int repeat_delay
Definition conf.h:163
char * difficulty
Definition conf.h:181
double compression_mult
Definition conf.h:183
int fps_show
Definition conf.h:146
int mesg_visible
Definition conf.h:157
double sound
Definition conf.h:141
double zoom_far
Definition conf.h:169
double gamma_correction
Definition conf.h:132
int explicit_dim
Definition conf.h:112
int nosave
Definition conf.h:199
unsigned int doubletap_sens
Definition conf.h:185
int lua_enet
Definition conf.h:197
double bg_brightness
Definition conf.h:127
int font_size_console
Definition conf.h:175
int zoom_manual
Definition conf.h:168
int redirect_file
Definition conf.h:184
double map_overlay_opacity
Definition conf.h:158
double nebu_scale
Definition conf.h:114
char * dev_data_dir
Definition conf.h:209
int mouse_fly
Definition conf.h:188
double nebu_nonuniformity
Definition conf.h:128
double zoom_near
Definition conf.h:171
char * lastversion
Definition conf.h:200
int low_memory
Definition conf.h:133
int translation_warning_seen
Definition conf.h:201
int fsaa
Definition conf.h:106
int fpu_except
Definition conf.h:206
int borderless
Definition conf.h:119
int font_size_intro
Definition conf.h:176
int joystick_ind
Definition conf.h:153
char * joystick_nam
Definition conf.h:154