/
config.h
100 lines (84 loc) · 2.15 KB
/
config.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
/*
Copyright (c) 2017-2020 ByteBit
This file is part of BetterSpades.
BetterSpades is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BetterSpades is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BetterSpades. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include <stddef.h>
#include "list.h"
struct config_file_entry {
char section[32];
char name[32];
char value[32];
};
extern struct RENDER_OPTIONS {
char name[16];
int opengl14;
int color_correction;
int shadow_entities;
int ambient_occlusion;
float render_distance;
int window_width;
int window_height;
int multisamples;
int player_arms;
int fullscreen;
int greedy_meshing;
int vsync;
float mouse_sensitivity;
int show_news;
int show_fps;
int volume;
int voxlap_models;
int force_displaylist;
int invert_y;
int smooth_fog;
float camera_fov;
int hold_down_sights;
int chat_shadow;
} settings, settings_tmp;
extern struct list config_keys;
struct config_key_pair {
int internal;
int def;
int original;
int toggle;
char name[24];
char display[24];
char category[24];
};
enum {
CONFIG_TYPE_STRING,
CONFIG_TYPE_INT,
CONFIG_TYPE_FLOAT,
};
struct config_setting {
void* value;
int type;
int min;
int max;
char name[32];
char help[32];
int defaults[8];
int defaults_length;
void (*label_callback)(char* buffer, size_t length, int value, size_t index);
};
extern struct list config_settings;
void config_register_key(int internal, int def, const char* name, int toggle, const char* display,
const char* category);
int config_key_translate(int key, int dir, int* results);
struct config_key_pair* config_key(int key);
void config_key_reset_togglestates();
void config_reload(void);
void config_save(void);
#endif