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/i_video.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/i_video.c')
-rw-r--r-- | src/i_video.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/i_video.c b/src/i_video.c index 76ad23af..8fb1f178 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -2161,23 +2161,23 @@ void I_InitGraphics(void) void I_BindVideoVariables(void) { - M_BindVariable("use_mouse", &usemouse); - M_BindVariable("autoadjust_video_settings", &autoadjust_video_settings); - M_BindVariable("fullscreen", &fullscreen); - M_BindVariable("aspect_ratio_correct", &aspect_ratio_correct); - M_BindVariable("startup_delay", &startup_delay); - M_BindVariable("screen_width", &screen_width); - M_BindVariable("screen_height", &screen_height); - M_BindVariable("screen_bpp", &screen_bpp); - M_BindVariable("grabmouse", &grabmouse); - M_BindVariable("mouse_acceleration", &mouse_acceleration); - M_BindVariable("mouse_threshold", &mouse_threshold); - M_BindVariable("video_driver", &video_driver); - M_BindVariable("window_position", &window_position); - M_BindVariable("usegamma", &usegamma); - M_BindVariable("vanilla_keyboard_mapping", &vanilla_keyboard_mapping); - M_BindVariable("novert", &novert); - M_BindVariable("png_screenshots", &png_screenshots); + M_BindIntVariable("use_mouse", &usemouse); + M_BindIntVariable("autoadjust_video_settings", &autoadjust_video_settings); + M_BindIntVariable("fullscreen", &fullscreen); + M_BindIntVariable("aspect_ratio_correct", &aspect_ratio_correct); + M_BindIntVariable("startup_delay", &startup_delay); + M_BindIntVariable("screen_width", &screen_width); + M_BindIntVariable("screen_height", &screen_height); + M_BindIntVariable("screen_bpp", &screen_bpp); + M_BindIntVariable("grabmouse", &grabmouse); + M_BindFloatVariable("mouse_acceleration", &mouse_acceleration); + M_BindIntVariable("mouse_threshold", &mouse_threshold); + M_BindStringVariable("video_driver", &video_driver); + M_BindStringVariable("window_position", &window_position); + M_BindIntVariable("usegamma", &usegamma); + M_BindIntVariable("vanilla_keyboard_mapping", &vanilla_keyboard_mapping); + M_BindIntVariable("novert", &novert); + M_BindIntVariable("png_screenshots", &png_screenshots); // Windows Vista or later? Set screen color depth to // 32 bits per pixel, as 8-bit palettized screen modes |