win_opengl: UI for options and add them to config. Reloading changed options at runtime. Improved framerate limitter.
This commit is contained in:
21
src/config.c
21
src/config.c
@@ -528,6 +528,12 @@ load_general(void)
|
||||
#if USE_DISCORD
|
||||
enable_discord = !!config_get_int(cat, "enable_discord", 0);
|
||||
#endif
|
||||
|
||||
#ifdef DEV_BRANCH /* feature-opengl */
|
||||
video_framerate = config_get_int(cat, "video_gl_framerate", -1);
|
||||
video_vsync = config_get_int(cat, "video_gl_vsync", 0);
|
||||
strcpy_s(video_shader, sizeof(video_shader), config_get_string(cat, "video_gl_shader", ""));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1968,6 +1974,21 @@ save_general(void)
|
||||
config_delete_var(cat, "enable_discord");
|
||||
#endif
|
||||
|
||||
#ifdef DEV_BRANCH /* feature-opengl */
|
||||
if (video_framerate != -1)
|
||||
config_set_int(cat, "video_gl_framerate", video_framerate);
|
||||
else
|
||||
config_delete_var(cat, "video_gl_framerate");
|
||||
if (video_vsync != 0)
|
||||
config_set_int(cat, "video_gl_vsync", video_vsync);
|
||||
else
|
||||
config_delete_var(cat, "video_gl_vsync");
|
||||
if (strlen(video_shader) > 0)
|
||||
config_set_string(cat, "video_gl_shader", video_shader);
|
||||
else
|
||||
config_delete_var(cat, "video_gl_shader");
|
||||
#endif
|
||||
|
||||
delete_section_if_empty(cat);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user