From b39121c6a682eb8ae5efd29a875bd7c098185f04 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 20 Feb 2015 00:31:09 -0500 Subject: 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. --- src/heretic/d_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/heretic/d_main.c') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 8389a23d..2a57016f 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -756,20 +756,20 @@ void D_BindVariables(void) M_BindMenuControls(); M_BindMapControls(); - M_BindVariable("mouse_sensitivity", &mouseSensitivity); - M_BindVariable("sfx_volume", &snd_MaxVolume); - M_BindVariable("music_volume", &snd_MusicVolume); - M_BindVariable("screenblocks", &screenblocks); - M_BindVariable("snd_channels", &snd_Channels); - M_BindVariable("show_endoom", &show_endoom); - M_BindVariable("graphical_startup", &graphical_startup); + M_BindIntVariable("mouse_sensitivity", &mouseSensitivity); + M_BindIntVariable("sfx_volume", &snd_MaxVolume); + M_BindIntVariable("music_volume", &snd_MusicVolume); + M_BindIntVariable("screenblocks", &screenblocks); + M_BindIntVariable("snd_channels", &snd_Channels); + M_BindIntVariable("show_endoom", &show_endoom); + M_BindIntVariable("graphical_startup", &graphical_startup); for (i=0; i<10; ++i) { char buf[12]; M_snprintf(buf, sizeof(buf), "chatmacro%i", i); - M_BindVariable(buf, &chat_macros[i]); + M_BindStringVariable(buf, &chat_macros[i]); } } -- cgit v1.2.3