2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
19 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef SETTINGS_HPP_INCLUDED
24 #define SETTINGS_HPP_INCLUDED
32 class GameInputHandler
;
34 /* universal settings */
35 extern int gd_language
;
36 extern std::string gd_username
;
37 extern std::string gd_theme
;
38 extern bool gd_no_invisible_outbox
;
39 extern bool gd_all_caves_selectable
;
40 extern bool gd_import_as_all_caves_selectable
;
41 extern bool gd_use_bdcff_highscore
;
42 extern int gd_pal_emu_scanline_shade
;
43 extern bool gd_fine_scroll
;
44 extern bool gd_particle_effects
;
45 extern bool gd_show_story
;
46 extern bool gd_show_name_of_game
;
47 extern int gd_status_bar_colors
;
49 /* palette settings */
50 extern int gd_c64_palette
;
51 extern int gd_c64dtv_palette
;
52 extern int gd_atari_palette
;
53 extern int gd_preferred_palette
;
59 extern bool gd_game_view
; /* show animated cells instead of arrows & ... */
60 extern bool gd_colored_objects
; /* show objects with different color */
61 extern bool gd_show_object_list
; /* show object list */
62 extern int gd_editor_window_width
; /* window size */
63 extern int gd_editor_window_height
; /* window size */
64 extern bool gd_fast_uncover_in_test
;
67 extern bool gd_show_preview
;
70 extern int gd_graphics_engine
;
71 extern bool gd_fullscreen
;
72 extern int gd_cell_scale_factor_game
;
73 extern int gd_cell_scale_type_game
;
74 extern bool gd_pal_emulation_game
;
75 extern int gd_cell_scale_factor_editor
;
76 extern int gd_cell_scale_type_editor
;
77 extern bool gd_pal_emulation_editor
;
81 extern int gd_gtk_key_left
;
82 extern int gd_gtk_key_right
;
83 extern int gd_gtk_key_up
;
84 extern int gd_gtk_key_down
;
85 extern int gd_gtk_key_fire_1
;
86 extern int gd_gtk_key_fire_2
;
87 extern int gd_gtk_key_suicide
;
88 extern int gd_gtk_key_fast_forward
;
89 extern int gd_gtk_key_status_bar
;
90 extern int gd_gtk_key_restart_level
;
93 /* html output option */
94 extern char *gd_html_stylesheet_filename
;
95 extern char *gd_html_favicon_filename
;
102 extern int gd_sdl_key_left
;
103 extern int gd_sdl_key_right
;
104 extern int gd_sdl_key_up
;
105 extern int gd_sdl_key_down
;
106 extern int gd_sdl_key_fire_1
;
107 extern int gd_sdl_key_fire_2
;
108 extern int gd_sdl_key_suicide
;
109 extern int gd_sdl_key_fast_forward
;
110 extern int gd_sdl_key_status_bar
;
111 extern int gd_sdl_key_restart_level
;
118 extern bool gd_sound_enabled
;
119 extern bool gd_sound_16bit_mixing
;
120 extern bool gd_sound_44khz_mixing
;
121 extern bool gd_sound_stereo
;
122 extern bool gd_classic_sound
;
123 extern int gd_sound_chunks_volume_percent
;
124 extern int gd_sound_music_volume_percent
;
126 extern std::string gd_shader
;
127 extern int shader_pal_radial_distortion
;
128 extern int shader_pal_chroma_to_luma_strength
;
129 extern int shader_pal_luma_to_chroma_strength
;
130 extern int shader_pal_scanline_shade_luma
;
131 extern int shader_pal_phosphor_shade
;
132 extern int shader_pal_random_scanline_displace
;
133 extern int shader_pal_random_y
;
134 extern int shader_pal_random_uv
;
135 extern int shader_pal_luma_x_blur
;
136 extern int shader_pal_chroma_x_blur
;
137 extern int shader_pal_chroma_y_blur
;
138 #endif /* if gd_sound */
141 /* command line parameters */
142 extern int gd_param_license
;
143 extern char **gd_param_cavenames
;
144 extern gboolean gd_param_debug
;
145 extern gboolean gd_param_load_default_settings
;
147 /* gdash directories */
148 extern std::string gd_user_config_dir
;
149 extern std::string gd_system_data_dir
;
150 extern std::string gd_system_caves_dir
;
151 extern std::string gd_system_music_dir
;
153 extern std::vector
<std::string
> gd_sound_dirs
, gd_themes_dirs
, gd_fonts_dirs
, gd_shaders_dirs
;
155 extern const char *gd_languages_names
[];
157 /* init settings (directories), and load language files */
158 void gd_settings_init();
159 void gd_settings_init_dirs();
160 void gd_settings_set_locale();
161 void gd_settings_init_translation();
163 /* settings loading and saving */
164 void gd_save_settings();
165 void gd_load_settings();
167 /* command line arguments parsing */
168 GOptionContext
*gd_option_context_new();
188 bool restart
; // a setting which requires a restart
189 const char **stringv
;
190 char const *description
;
191 int min
, max
; // for integers
192 std::string
*stringvar
; // for the theme and the scaler
194 unsigned page
; // generated inside the game
197 Setting
*gd_get_game_settings_array();
198 Setting
*gd_get_keyboard_settings_array(GameInputHandler
*gih
);
199 void gd_settings_array_prepare(Setting
*settings
, SettingType which
,
200 std::vector
<std::string
> const & strings
, int *var
);
201 void gd_settings_array_unprepare(Setting
*settings
, SettingType which
);