Correct logic of BSP back/front tests
[neverball] / share / config.h
1 /*
2  * Copyright (C) 2003 Robert Kooima
3  *
4  * NEVERBALL is  free software; you can redistribute  it and/or modify
5  * it under the  terms of the GNU General  Public License as published
6  * by the Free  Software Foundation; either version 2  of the License,
7  * or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
11  * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
12  * General Public License for more details.
13  */
14
15 #ifndef CONFIG_H
16 #define CONFIG_H
17
18 /*
19  * This file contains:
20  * 1- some global config methods (stored in a config file)
21  * 2- some SDL based functions
22  *
23  * If you're looking for constants, you should also see base_config.h
24  */
25
26 #include <SDL.h>
27
28 #include "base_config.h"
29 #include "lang.h"
30
31 /*---------------------------------------------------------------------------*/
32
33 enum {
34     CONFIG_FULLSCREEN,
35     CONFIG_WIDTH,
36     CONFIG_HEIGHT,
37     CONFIG_STEREO,
38     CONFIG_CAMERA,
39     CONFIG_TEXTURES,
40     CONFIG_GEOMETRY,
41     CONFIG_REFLECTION,
42     CONFIG_MULTISAMPLE,
43     CONFIG_MIPMAP,
44     CONFIG_ANISO,
45     CONFIG_BACKGROUND,
46     CONFIG_SHADOW,
47     CONFIG_AUDIO_BUFF,
48     CONFIG_MOUSE_SENSE,
49     CONFIG_MOUSE_INVERT,
50     CONFIG_VSYNC,
51     CONFIG_NICE,
52     CONFIG_FPS,
53     CONFIG_SOUND_VOLUME,
54     CONFIG_MUSIC_VOLUME,
55     CONFIG_JOYSTICK,
56     CONFIG_JOYSTICK_DEVICE,
57     CONFIG_JOYSTICK_AXIS_X,
58     CONFIG_JOYSTICK_AXIS_Y,
59     CONFIG_JOYSTICK_BUTTON_A,
60     CONFIG_JOYSTICK_BUTTON_B,
61     CONFIG_JOYSTICK_BUTTON_R,
62     CONFIG_JOYSTICK_BUTTON_L,
63     CONFIG_JOYSTICK_BUTTON_EXIT,
64     CONFIG_JOYSTICK_CAMERA_1,
65     CONFIG_JOYSTICK_CAMERA_2,
66     CONFIG_JOYSTICK_CAMERA_3,
67     CONFIG_JOYSTICK_DPAD_L,
68     CONFIG_JOYSTICK_DPAD_R,
69     CONFIG_JOYSTICK_DPAD_U,
70     CONFIG_JOYSTICK_DPAD_D,
71     CONFIG_KEY_CAMERA_1,
72     CONFIG_KEY_CAMERA_2,
73     CONFIG_KEY_CAMERA_3,
74     CONFIG_KEY_CAMERA_R,
75     CONFIG_KEY_CAMERA_L,
76     CONFIG_VIEW_FOV,
77     CONFIG_VIEW_DP,
78     CONFIG_VIEW_DC,
79     CONFIG_VIEW_DZ,
80     CONFIG_ROTATE_FAST,
81     CONFIG_ROTATE_SLOW,
82     CONFIG_KEY_FORWARD,
83     CONFIG_KEY_BACKWARD,
84     CONFIG_KEY_LEFT,
85     CONFIG_KEY_RIGHT,
86     CONFIG_KEY_PAUSE,
87     CONFIG_KEY_RESTART,
88     CONFIG_KEY_SCORE_NEXT,
89     CONFIG_CHEAT,
90     CONFIG_STATS,
91     CONFIG_UNIFORM,
92     CONFIG_SCREENSHOT,
93     CONFIG_LOCK_GOALS,
94
95     CONFIG_OPTION_D_COUNT
96 };
97
98 enum {
99     CONFIG_PLAYER,
100     CONFIG_BALL,
101     CONFIG_WIIMOTE_ADDR,
102     CONFIG_REPLAY_NAME,
103
104     CONFIG_OPTION_S_COUNT
105 };
106
107 /*---------------------------------------------------------------------------*/
108
109 #define DEFAULT_FULLSCREEN           0
110 #define DEFAULT_WIDTH                800
111 #define DEFAULT_HEIGHT               600
112 #define DEFAULT_STEREO               0
113 #define DEFAULT_CAMERA               0
114 #define DEFAULT_TEXTURES             1
115 #define DEFAULT_GEOMETRY             1
116 #define DEFAULT_REFLECTION           1
117 #define DEFAULT_MULTISAMPLE          0
118 #define DEFAULT_MIPMAP               0
119 #define DEFAULT_ANISO                0
120 #define DEFAULT_BACKGROUND           1
121 #define DEFAULT_SHADOW               1
122 #define DEFAULT_AUDIO_BUFF           AUDIO_BUFF_HI
123 #define DEFAULT_MOUSE_SENSE          300
124 #define DEFAULT_MOUSE_INVERT         0
125 #define DEFAULT_VSYNC                1
126 #define DEFAULT_NICE                 0
127 #define DEFAULT_FPS                  0
128 #define DEFAULT_SOUND_VOLUME         10
129 #define DEFAULT_MUSIC_VOLUME         6
130 #define DEFAULT_JOYSTICK             0
131 #define DEFAULT_JOYSTICK_DEVICE      0
132 #define DEFAULT_JOYSTICK_AXIS_X      0
133 #define DEFAULT_JOYSTICK_AXIS_Y      1
134 #define DEFAULT_JOYSTICK_BUTTON_A    0
135 #define DEFAULT_JOYSTICK_BUTTON_B    1
136 #define DEFAULT_JOYSTICK_BUTTON_R    2
137 #define DEFAULT_JOYSTICK_BUTTON_L    3
138 #define DEFAULT_JOYSTICK_BUTTON_EXIT 4
139 #define DEFAULT_JOYSTICK_CAMERA_1    5
140 #define DEFAULT_JOYSTICK_CAMERA_2    6
141 #define DEFAULT_JOYSTICK_CAMERA_3    7
142 #define DEFAULT_JOYSTICK_DPAD_L      8
143 #define DEFAULT_JOYSTICK_DPAD_R      9
144 #define DEFAULT_JOYSTICK_DPAD_U      10
145 #define DEFAULT_JOYSTICK_DPAD_D      11
146 #define DEFAULT_WIIMOTE_ADDR         ""
147 #define DEFAULT_KEY_CAMERA_1         SDLK_F1
148 #define DEFAULT_KEY_CAMERA_2         SDLK_F2
149 #define DEFAULT_KEY_CAMERA_3         SDLK_F3
150 #define DEFAULT_KEY_CAMERA_R         SDLK_d
151 #define DEFAULT_KEY_CAMERA_L         SDLK_s
152 #define DEFAULT_VIEW_FOV             50
153 #define DEFAULT_VIEW_DP              75
154 #define DEFAULT_VIEW_DC              25
155 #define DEFAULT_VIEW_DZ              200
156 #define DEFAULT_ROTATE_SLOW          100
157 #define DEFAULT_ROTATE_FAST          200
158 #define DEFAULT_PLAYER               ""
159 #define DEFAULT_BALL                 "ball/basic-ball/basic-ball"
160 #define DEFAULT_REPLAY_NAME          "%s-%l"
161 #define DEFAULT_CHEAT                0
162 #define DEFAULT_KEY_FORWARD          SDLK_UP
163 #define DEFAULT_KEY_BACKWARD         SDLK_DOWN
164 #define DEFAULT_KEY_LEFT             SDLK_LEFT
165 #define DEFAULT_KEY_RIGHT            SDLK_RIGHT
166 #define DEFAULT_KEY_PAUSE            SDLK_ESCAPE
167 #define DEFAULT_KEY_RESTART          SDLK_r
168 #define DEFAULT_KEY_SCORE_NEXT       SDLK_TAB
169 #define DEFAULT_STATS                0
170 #define DEFAULT_UNIFORM              0
171 #define DEFAULT_SCREENSHOT           0
172 #define DEFAULT_LOCK_GOALS           0
173
174 /*---------------------------------------------------------------------------*/
175
176 void config_init(void);
177 void config_load(void);
178 void config_save(void);
179 int  config_mode(int, int, int);
180
181 int  config_perf(void);
182 void config_sync(void);
183 void config_swap(void);
184
185 /*---------------------------------------------------------------------------*/
186
187 void config_set_d(int, int);
188 void config_tgl_d(int);
189 int  config_tst_d(int, int);
190 int  config_get_d(int);
191
192 void config_set_s(int, const char *);
193 void config_get_s(int, char *, int);
194
195 /*---------------------------------------------------------------------------*/
196
197 void config_set_grab(int w);
198 void config_clr_grab(void);
199 int  config_get_grab(void);
200
201 /*---------------------------------------------------------------------------*/
202
203 int  config_cheat(void);
204 void config_set_cheat(void);
205 void config_clr_cheat(void);
206
207 /*---------------------------------------------------------------------------*/
208
209 int config_screenshot(void);
210
211 /*---------------------------------------------------------------------------*/
212
213 void config_push_persp(float, float, float);
214 void config_push_ortho(void);
215 void config_pop_matrix(void);
216 void config_clear(void);
217
218 /*---------------------------------------------------------------------------*/
219
220 #endif