-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.h
123 lines (100 loc) · 2.04 KB
/
settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef SETTINGS_H_
#define SETTINGS_H_
struct rgba {
float r;
float g;
float b;
float a;
};
struct sprite_settings {
char *name;
char *source;
float width;
float height;
struct rgba *color;
};
struct text_settings {
char *text;
float scale;
struct rgba *color;
int ttl;
};
struct powerup_settings {
int ttl;
struct sprite_settings *sprite;
struct text_settings *text;
};
struct missile_settings {
float speed;
int refire_interval;
struct sprite_settings *sprite;
};
struct matrix;
struct mesh_settings {
struct matrix *transform;
char *source;
};
struct ship_settings {
float speed;
struct mesh_settings *mesh;
struct sprite_settings *shield_sprite;
};
struct general_settings {
int god_mode;
int background;
int random_foes;
int sound;
int start_level;
int start_wave;
int all_powerups;
int dump_stick_state;
int playback_stick_state;
int dump_frames;
int use_vbo;
int use_fbo;
int use_pbuffer;
int use_pbuffer_render_texture;
int water_texture_width;
int serialization;
struct rgba *water_color;
};
enum resolution {
RES_640X480,
RES_800X600,
RES_1024X768,
NUM_RESOLUTIONS
};
extern struct resolution_info {
int width;
int height;
} resolution_info[NUM_RESOLUTIONS];
enum control_type {
CONTROL_KEYBOARD,
CONTROL_HYBRID,
CONTROL_JOYSTICK,
NUM_CONTROL_TYPES
};
struct settings {
struct general_settings *static_settings;
/* control */
enum control_type control_type;
int pad_keysyms[8];
int pad_sticks[8];
/* display */
int fullscreen_enabled;
enum resolution resolution;
int water_detail;
};
extern struct settings settings;
extern struct ship_settings *ship_settings;
#include "powerup.h"
extern struct powerup_settings *powerup_settings[NUM_POWERUP_TYPES];
#include "missile.h"
extern struct missile_settings *missile_settings[NUM_MISSILE_TYPES];
#include "foe.h"
extern struct mesh_settings *foe_mesh_settings[NUM_FOE_TYPES];
int
load_settings(struct settings *settings, const char *file_name);
void
save_settings(const struct settings *settings, const char *file_name);
#endif /* SETTINGS_H_ */