diff options
author | Simon Howard | 2015-02-20 00:31:09 -0500 |
---|---|---|
committer | Simon Howard | 2015-02-20 00:33:12 -0500 |
commit | b39121c6a682eb8ae5efd29a875bd7c098185f04 (patch) | |
tree | c6a8b42412682c49d73aff7c794e333e55c807bc /src/strife/d_main.c | |
parent | 1f5ce047ad6cb709f746b794b4a2dea9e2f89fb6 (diff) | |
download | chocolate-doom-b39121c6a682eb8ae5efd29a875bd7c098185f04.tar.gz chocolate-doom-b39121c6a682eb8ae5efd29a875bd7c098185f04.tar.bz2 chocolate-doom-b39121c6a682eb8ae5efd29a875bd7c098185f04.zip |
Refactor config file API.
The config file API previously relied on binding config variables
using M_BindVariable() which took a void pointer. It occurred to me
that if used on a boolean variable, this would be erroneous, but the
void pointer would make it impossible to tell. Split this into
separate M_Bind{Foo}Variable() functions based on type, which allows
for proper type checking on the pointers that are passed.
Vaguely related to #509.
Diffstat (limited to 'src/strife/d_main.c')
-rw-r--r-- | src/strife/d_main.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/strife/d_main.c b/src/strife/d_main.c index 5cc8be5e..35d2c908 100644 --- a/src/strife/d_main.c +++ b/src/strife/d_main.c @@ -431,21 +431,22 @@ void D_BindVariables(void) // * screenblocks -> screensize // * Added nickname, comport - M_BindVariable("mouse_sensitivity", &mouseSensitivity); - M_BindVariable("sfx_volume", &sfxVolume); - M_BindVariable("music_volume", &musicVolume); - M_BindVariable("voice_volume", &voiceVolume); - M_BindVariable("show_talk", &dialogshowtext); - M_BindVariable("screensize", &screenblocks); - M_BindVariable("snd_channels", &snd_channels); - M_BindVariable("vanilla_savegame_limit", &vanilla_savegame_limit); - M_BindVariable("vanilla_demo_limit", &vanilla_demo_limit); - M_BindVariable("show_endoom", &show_endoom); - M_BindVariable("back_flat", &back_flat); - M_BindVariable("graphical_startup", &graphical_startup); - - M_BindVariable("nickname", &nickname); - M_BindVariable("comport", &comport); + M_BindIntVariable("mouse_sensitivity", &mouseSensitivity); + M_BindIntVariable("sfx_volume", &sfxVolume); + M_BindIntVariable("music_volume", &musicVolume); + M_BindIntVariable("voice_volume", &voiceVolume); + M_BindIntVariable("show_talk", &dialogshowtext); + M_BindIntVariable("screensize", &screenblocks); + M_BindIntVariable("snd_channels", &snd_channels); + M_BindIntVariable("vanilla_savegame_limit", &vanilla_savegame_limit); + M_BindIntVariable("vanilla_demo_limit", &vanilla_demo_limit); + M_BindIntVariable("show_endoom", &show_endoom); + M_BindIntVariable("graphical_startup", &graphical_startup); + + M_BindStringVariable("back_flat", &back_flat); + M_BindStringVariable("nickname", &nickname); + + M_BindIntVariable("comport", &comport); // Multiplayer chat macros @@ -454,7 +455,7 @@ void D_BindVariables(void) char buf[12]; M_snprintf(buf, sizeof(buf), "chatmacro%i", i); - M_BindVariable(buf, &chat_macros[i]); + M_BindStringVariable(buf, &chat_macros[i]); } } |