]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/client_config.c
Make texture batching optional (for OpenGL 3.3 compat)
[dragonblocks_alpha.git] / src / client / client_config.c
1 #include "client/client_config.h"
2 #include "common/config.h"
3
4 struct ClientConfig client_config = {
5         .antialiasing = 4,
6         .mipmap = true,
7         .view_distance = 255.0,
8         .vsync = true,
9         .meshgen_threads = 4,
10         .swap_mouse_buttons = true,
11         .texture_batching = true,
12 };
13
14 static ConfigEntry config_entries[] = {
15         {
16                 .type = CONFIG_UINT,
17                 .key = "antialiasing",
18                 .value = &client_config.antialiasing,
19         },
20         {
21                 .type = CONFIG_BOOL,
22                 .key = "mipmap",
23                 .value = &client_config.mipmap,
24         },
25         {
26                 .type = CONFIG_FLOAT,
27                 .key = "view_distance",
28                 .value = &client_config.view_distance,
29         },
30         {
31                 .type = CONFIG_BOOL,
32                 .key = "vsync",
33                 .value = &client_config.vsync,
34         },
35         {
36                 .type = CONFIG_UINT,
37                 .key = "meshgen_threads",
38                 .value = &client_config.meshgen_threads,
39         },
40         {
41                 .type = CONFIG_BOOL,
42                 .key = "swap_mouse_buttons",
43                 .value = &client_config.meshgen_threads,
44         },
45         {
46                 .type = CONFIG_BOOL,
47                 .key = "texture_batching",
48                 .value = &client_config.texture_batching,
49         },
50 };
51
52 __attribute__((constructor)) static void client_config_init()
53 {
54         config_read("client.conf", config_entries, sizeof config_entries / sizeof *config_entries);
55 }
56
57 __attribute__((destructor)) static void client_config_deinit()
58 {
59         config_free(config_entries, sizeof config_entries / sizeof *config_entries);
60 }