summaryrefslogtreecommitdiff
path: root/src/setup/display.c
diff options
context:
space:
mode:
authorSimon Howard2015-02-20 00:31:09 -0500
committerSimon Howard2015-02-20 00:33:12 -0500
commitb39121c6a682eb8ae5efd29a875bd7c098185f04 (patch)
treec6a8b42412682c49d73aff7c794e333e55c807bc /src/setup/display.c
parent1f5ce047ad6cb709f746b794b4a2dea9e2f89fb6 (diff)
downloadchocolate-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/setup/display.c')
-rw-r--r--src/setup/display.c26
1 files changed, 13 insertions, 13 deletions
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