From 8f0636396db739b4a036ca92fdd5f38ea86379aa Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 12 Oct 2013 19:17:00 +0200 Subject: [PATCH] r_restart on conwidth/conheight change to reload fonts at the proper sizes --- qcsrc/menu/xonotic/slider_resolution.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qcsrc/menu/xonotic/slider_resolution.c b/qcsrc/menu/xonotic/slider_resolution.c index 0c33e3455..a7cf04bf7 100644 --- a/qcsrc/menu/xonotic/slider_resolution.c +++ b/qcsrc/menu/xonotic/slider_resolution.c @@ -61,8 +61,16 @@ void updateConwidths(float width, float height, float pixelheight) f = 1; c = c * f; // fteqcc fail - cvar_set("vid_conwidth", ftos(rint(c_x))); - cvar_set("vid_conheight", ftos(rint(c_y))); + c_x = rint(c_x); + c_y = rint(c_y); + + if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight")) + { + cvar_set("vid_conwidth", ftos(c_x)); + cvar_set("vid_conheight", ftos(c_y)); + localcmd("\nr_restart\n"); + } + XonoticResolutionSlider_DataHasChanged = TRUE; } entity makeXonoticResolutionSlider() -- 2.39.2