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/setup/display.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/setup/display.c') diff --git a/src/setup/display.c b/src/setup/display.c index 090fd445..1398aaf0 100644 --- a/src/setup/display.c +++ b/src/setup/display.c @@ -700,28 +700,28 @@ void ConfigDisplay(void) void BindDisplayVariables(void) { - M_BindVariable("autoadjust_video_settings", &autoadjust_video_settings); - M_BindVariable("aspect_ratio_correct", &aspect_ratio_correct); - M_BindVariable("fullscreen", &fullscreen); - M_BindVariable("screen_width", &screen_width); - M_BindVariable("screen_height", &screen_height); - M_BindVariable("screen_bpp", &screen_bpp); - M_BindVariable("startup_delay", &startup_delay); - M_BindVariable("video_driver", &video_driver); - M_BindVariable("window_position", &window_position); - M_BindVariable("usegamma", &usegamma); - M_BindVariable("png_screenshots", &png_screenshots); + M_BindIntVariable("autoadjust_video_settings", &autoadjust_video_settings); + M_BindIntVariable("aspect_ratio_correct", &aspect_ratio_correct); + M_BindIntVariable("fullscreen", &fullscreen); + M_BindIntVariable("screen_width", &screen_width); + M_BindIntVariable("screen_height", &screen_height); + M_BindIntVariable("screen_bpp", &screen_bpp); + M_BindIntVariable("startup_delay", &startup_delay); + M_BindStringVariable("video_driver", &video_driver); + M_BindStringVariable("window_position", &window_position); + M_BindIntVariable("usegamma", &usegamma); + M_BindIntVariable("png_screenshots", &png_screenshots); if (gamemission == doom || gamemission == heretic || gamemission == strife) { - M_BindVariable("show_endoom", &show_endoom); + M_BindIntVariable("show_endoom", &show_endoom); } if (gamemission == heretic || gamemission == hexen || gamemission == strife) { - M_BindVariable("graphical_startup", &graphical_startup); + M_BindIntVariable("graphical_startup", &graphical_startup); } // Windows Vista or later? Set screen color depth to -- cgit v1.2.3