From 61404e25c472fd972af1455f5739e41e8627c828 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 11 Apr 2018 01:33:40 -0500 Subject: [PATCH] Restore setting r_colorbits in q3_ui In 2007 in ioquake3 unified-sdl branch (revision 1144) setting r_colorbits in q3_ui was removed but the Color Depth menu option was still kept. Setting r_colorbits was not removed from the Team Arena UI. In 2011 I removed the Color Depth menu option from q3_ui as it did not change any cvars. Yesterday I restored the option not realizing this and thinking that requesting 16-bit color depth worked. Add setting r_colorbits back to q3_ui so Color Depth menu option works again. I changed Color Depth options 'Default' to reset r_stencilbits instead of 0 and '32 bit' to use r_stencilbits 8 instead of not changing the value. However I discovered r_colorbits 16 does not actually work on my system (Debian Jessie x86_64 nvidia). ioquake3 was reporting the requested value instead of the actual obtained value. Fixed in my previous commit. --- code/q3_ui/ui_video.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/code/q3_ui/ui_video.c b/code/q3_ui/ui_video.c index 63540f22..093b5a2c 100644 --- a/code/q3_ui/ui_video.c +++ b/code/q3_ui/ui_video.c @@ -679,11 +679,24 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification ) trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue ); trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue ); - - trap_Cvar_Reset("r_colorbits"); - trap_Cvar_Reset("r_depthbits"); - trap_Cvar_Reset("r_stencilbits"); - + switch ( s_graphicsoptions.colordepth.curvalue ) + { + case 0: + trap_Cvar_SetValue( "r_colorbits", 0 ); + trap_Cvar_SetValue( "r_depthbits", 0 ); + trap_Cvar_Reset( "r_stencilbits" ); + break; + case 1: + trap_Cvar_SetValue( "r_colorbits", 16 ); + trap_Cvar_SetValue( "r_depthbits", 16 ); + trap_Cvar_SetValue( "r_stencilbits", 0 ); + break; + case 2: + trap_Cvar_SetValue( "r_colorbits", 32 ); + trap_Cvar_SetValue( "r_depthbits", 24 ); + trap_Cvar_SetValue( "r_stencilbits", 8 ); + break; + } trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue ); if ( s_graphicsoptions.geometry.curvalue == 2 )