From 8d9cdc0768e7acf41c3b618d85adfde8ee6b0a5c Mon Sep 17 00:00:00 2001 From: svdijk Date: Sun, 8 Nov 2015 18:20:54 +0100 Subject: [PATCH] Videomenu: Limit the ui scale option to integer values Fractional values look ugly. If people really want this they can set this from the console, we won't "advise" it from the menu. --- src/client/menu/videomenu.c | 56 ++++++++----------------------------- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/src/client/menu/videomenu.c b/src/client/menu/videomenu.c index 37aa168f..1a54a90d 100644 --- a/src/client/menu/videomenu.c +++ b/src/client/menu/videomenu.c @@ -165,31 +165,15 @@ ApplyChanges(void *unused) /* UI scaling */ if (s_uiscale_list.curvalue == 0) - { - Cvar_SetValue("gl_hudscale", 1); - } - else if (s_uiscale_list.curvalue == 1) { Cvar_SetValue("gl_hudscale", -1); } - else if (s_uiscale_list.curvalue == 2) + else if (s_uiscale_list.curvalue < 4) { - Cvar_SetValue("gl_hudscale", 1.5); - } - else if (s_uiscale_list.curvalue == 3) - { - Cvar_SetValue("gl_hudscale", 2); - } - else if (s_uiscale_list.curvalue == 4) - { - Cvar_SetValue("gl_hudscale", 2.5); - } - else if (s_uiscale_list.curvalue == 5) - { - Cvar_SetValue("gl_hudscale", 3); + Cvar_SetValue("gl_hudscale", s_uiscale_list.curvalue); } - if (s_uiscale_list.curvalue != 6) + if (s_uiscale_list.curvalue != 4) { Cvar_SetValue("gl_consolescale", gl_hudscale->value); Cvar_SetValue("gl_menuscale", gl_hudscale->value); @@ -276,12 +260,10 @@ VID_MenuInit(void) }; static const char *uiscale_names[] = { - "no (1x)", "auto", - "1.5x", + "no (1x)", "2x", - "2.5x", - "3.0x", + "3x", "custom", 0 }; @@ -409,35 +391,21 @@ VID_MenuInit(void) if (gl_hudscale->value != gl_consolescale->value || gl_hudscale->value != gl_menuscale->value) { - s_uiscale_list.curvalue = 6; - } - else if (gl_hudscale->value == 1) - { - s_uiscale_list.curvalue = 0; + s_uiscale_list.curvalue = 4; } else if (gl_hudscale->value < 0) { - s_uiscale_list.curvalue = 1; + s_uiscale_list.curvalue = 0; } - else if (gl_hudscale->value == 1.5f) + else if (gl_hudscale->value == 1 || + gl_hudscale->value == 2 || + gl_hudscale->value == 3) { - s_uiscale_list.curvalue = 2; - } - else if (gl_hudscale->value == 2) - { - s_uiscale_list.curvalue = 3; - } - else if (gl_hudscale->value == 2.5f) - { - s_uiscale_list.curvalue = 4; - } - else if (gl_hudscale->value == 3) - { - s_uiscale_list.curvalue = 5; + s_uiscale_list.curvalue = gl_hudscale->value; } else { - s_uiscale_list.curvalue = 6; + s_uiscale_list.curvalue = 4; } s_screensize_slider.generic.type = MTYPE_SLIDER;