Merge remote-tracking branch 'devnexen/gl1_videomenuupd'

This commit is contained in:
Yamagi 2022-11-06 18:05:25 +01:00
commit dfd154b533

View file

@ -43,6 +43,7 @@ extern cvar_t *vid_renderer;
static cvar_t *r_vsync;
static cvar_t *gl_anisotropic;
static cvar_t *gl_msaa_samples;
static cvar_t *gl1_colorlight;
static cvar_t *gl3_colorlight;
static menuframework_s s_opengl_menu;
@ -53,9 +54,12 @@ static menulist_s s_display_list;
static menulist_s s_uiscale_list;
static menuslider_s s_brightness_slider;
static menuslider_s s_fov_slider;
static menuslider_s s_intensity_slider;
static menuslider_s s_overbrightbits_slider;
static menulist_s s_colorlight_list;
static menuslider_s s_gl1_intensity_slider;
static menuslider_s s_gl3_intensity_slider;
static menuslider_s s_gl1_overbrightbits_slider;
static menuslider_s s_gl3_overbrightbits_slider;
static menulist_s s_gl1_colorlight_list;
static menulist_s s_gl3_colorlight_list;
static menulist_s s_fs_box;
static menulist_s s_vsync_list;
static menulist_s s_af_list;
@ -249,9 +253,14 @@ ApplyChanges(void *unused)
restart = true;
}
if (gl3_colorlight && gl3_colorlight->value != s_colorlight_list.curvalue)
if (gl3_colorlight && gl3_colorlight->value != s_gl3_colorlight_list.curvalue)
{
Cvar_SetValue("gl3_colorlight", s_colorlight_list.curvalue);
Cvar_SetValue("gl3_colorlight", s_gl3_colorlight_list.curvalue);
}
if (gl1_colorlight && gl1_colorlight->value != s_gl1_colorlight_list.curvalue)
{
Cvar_SetValue("gl1_colorlight", s_gl1_colorlight_list.curvalue);
}
/* anisotropic filtering */
@ -499,33 +508,57 @@ VID_MenuInit(void)
if (strcmp(vid_renderer->string, "gl3") == 0 || strcmp(vid_renderer->string, "gles3") == 0)
{
s_intensity_slider.generic.type = MTYPE_SLIDER;
s_intensity_slider.generic.name = "color intensity";
s_intensity_slider.generic.x = 0;
s_intensity_slider.generic.y = (y += 10);
s_intensity_slider.cvar = "gl3_intensity";
s_intensity_slider.minvalue = 0.1f;
s_intensity_slider.maxvalue = 256.0f;
gl1_colorlight = NULL;
s_gl3_intensity_slider.generic.type = MTYPE_SLIDER;
s_gl3_intensity_slider.generic.name = "color intensity";
s_gl3_intensity_slider.generic.x = 0;
s_gl3_intensity_slider.generic.y = (y += 10);
s_gl3_intensity_slider.cvar = "gl3_intensity";
s_gl3_intensity_slider.minvalue = 0.1f;
s_gl3_intensity_slider.maxvalue = 5.0f;
s_overbrightbits_slider.generic.type = MTYPE_SLIDER;
s_overbrightbits_slider.generic.name = "overbrights";
s_overbrightbits_slider.generic.x = 0;
s_overbrightbits_slider.generic.y = (y += 10);
s_overbrightbits_slider.cvar = "gl3_overbrightbits";
s_overbrightbits_slider.minvalue = 0.1f;
s_overbrightbits_slider.maxvalue = 256.0f;
s_gl3_overbrightbits_slider.generic.type = MTYPE_SLIDER;
s_gl3_overbrightbits_slider.generic.name = "overbrights";
s_gl3_overbrightbits_slider.generic.x = 0;
s_gl3_overbrightbits_slider.generic.y = (y += 10);
s_gl3_overbrightbits_slider.cvar = "gl3_overbrightbits";
s_gl3_overbrightbits_slider.minvalue = 0.1f;
s_gl3_overbrightbits_slider.maxvalue = 5.0f;
gl3_colorlight = Cvar_Get("gl3_colorlight", "1", CVAR_ARCHIVE);
s_colorlight_list.generic.type = MTYPE_SPINCONTROL;
s_colorlight_list.generic.name = "color light";
s_colorlight_list.generic.x = 0;
s_colorlight_list.generic.y = (y += 10);
s_colorlight_list.itemnames = yesno_names;
s_colorlight_list.curvalue = (gl3_colorlight->value != 0);
s_gl3_colorlight_list.generic.type = MTYPE_SPINCONTROL;
s_gl3_colorlight_list.generic.name = "color light";
s_gl3_colorlight_list.generic.x = 0;
s_gl3_colorlight_list.generic.y = (y += 10);
s_gl3_colorlight_list.itemnames = yesno_names;
s_gl3_colorlight_list.curvalue = (gl3_colorlight->value != 0);
}
else
{
gl3_colorlight = 0;
gl3_colorlight = NULL;
s_gl1_intensity_slider.generic.type = MTYPE_SLIDER;
s_gl1_intensity_slider.generic.name = "color intensity";
s_gl1_intensity_slider.generic.x = 0;
s_gl1_intensity_slider.generic.y = (y += 10);
s_gl1_intensity_slider.cvar = "gl1_intensity";
s_gl1_intensity_slider.minvalue = 1.0f;
s_gl1_intensity_slider.maxvalue = 10.0f;
s_gl1_overbrightbits_slider.generic.type = MTYPE_SLIDER;
s_gl1_overbrightbits_slider.generic.name = "overbrights";
s_gl1_overbrightbits_slider.generic.x = 0;
s_gl1_overbrightbits_slider.generic.y = (y += 10);
s_gl1_overbrightbits_slider.cvar = "gl1_overbrightbits";
s_gl1_overbrightbits_slider.minvalue = 0;
s_gl1_overbrightbits_slider.maxvalue = 3;
gl1_colorlight = Cvar_Get("gl1_colorlight", "1", CVAR_ARCHIVE);
s_gl1_colorlight_list.generic.type = MTYPE_SPINCONTROL;
s_gl1_colorlight_list.generic.name = "color light";
s_gl1_colorlight_list.generic.x = 0;
s_gl1_colorlight_list.generic.y = (y += 10);
s_gl1_colorlight_list.itemnames = yesno_names;
s_gl1_colorlight_list.curvalue = (gl1_colorlight->value != 0);
}
s_uiscale_list.generic.type = MTYPE_SPINCONTROL;
@ -625,9 +658,15 @@ VID_MenuInit(void)
Menu_AddItem(&s_opengl_menu, (void *)&s_fov_slider);
if (strcmp(vid_renderer->string, "gl3") == 0 || strcmp(vid_renderer->string, "gles3") == 0)
{
Menu_AddItem(&s_opengl_menu, (void *)&s_intensity_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_overbrightbits_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_colorlight_list);
Menu_AddItem(&s_opengl_menu, (void *)&s_gl3_intensity_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_gl3_overbrightbits_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_gl3_colorlight_list);
}
else if (strcmp(vid_renderer->string, "gl1") == 0)
{
Menu_AddItem(&s_opengl_menu, (void *)&s_gl1_intensity_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_gl1_overbrightbits_slider);
Menu_AddItem(&s_opengl_menu, (void *)&s_gl1_colorlight_list);
}
Menu_AddItem(&s_opengl_menu, (void *)&s_uiscale_list);
Menu_AddItem(&s_opengl_menu, (void *)&s_fs_box);