From de9dda74321c341803bf0deff38c9802b4c8ba3b Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Thu, 2 Aug 2012 14:59:51 +0200 Subject: [PATCH] Restart the refresher when certain values are changed via the menu --- src/client/menu/videomenu.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/client/menu/videomenu.c b/src/client/menu/videomenu.c index 9b9c628c..02f100e2 100644 --- a/src/client/menu/videomenu.c +++ b/src/client/menu/videomenu.c @@ -81,21 +81,42 @@ ResetDefaults(void *unused) static void ApplyChanges(void *unused) { - Cvar_SetValue("gl_picmip", 3 - s_tq_slider.curvalue); + qboolean restart = false; + + if (gl_picmip->value != (3 - s_tq_slider.curvalue)) + { + + Cvar_SetValue("gl_picmip", 3 - s_tq_slider.curvalue); + restart = true; + } + + if (gl_ext_palettedtexture->value != s_paletted_texture_box.curvalue) + { + Cvar_SetValue("gl_ext_palettedtexture", s_paletted_texture_box.curvalue); + restart = true; + } + + /* Restarts automatically */ Cvar_SetValue("vid_fullscreen", s_fs_box.curvalue); - Cvar_SetValue("gl_ext_palettedtexture", s_paletted_texture_box.curvalue); /* custom mode */ if (s_mode_list.curvalue != CUSTOM_MODE) { + /* Restarts automatically */ Cvar_SetValue("gl_mode", s_mode_list.curvalue); } else { + /* Restarts automatically */ Cvar_SetValue("gl_mode", -1); } - M_ForceMenuOff(); + if (restart) + { + Cbuf_AddText("vid_restart\n"); + } + + //M_ForceMenuOff(); } void