+void M_Menu_Options_Graphics_f (void)
+{
+ key_dest = key_menu;
+ m_state = m_options_graphics;
+ m_entersound = true;
+}
+
+extern cvar_t r_shadow_gloss;
+extern cvar_t r_shadow_realtime_dlight;
+extern cvar_t r_shadow_realtime_dlight_shadows;
+extern cvar_t r_shadow_realtime_world;
+extern cvar_t r_shadow_realtime_world_dlightshadows;
+extern cvar_t r_shadow_realtime_world_lightmaps;
+extern cvar_t r_shadow_realtime_world_shadows;
+
+void M_Menu_Options_Graphics_AdjustSliders (int dir)
+{
+ int optnum;
+ S_LocalSound ("sound/misc/menu3.wav");
+
+ optnum = 0;
+
+ if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_gloss, bound(0, r_shadow_gloss.integer + dir, 2));
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_dlight, !r_shadow_realtime_dlight.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_dlight_shadows, !r_shadow_realtime_dlight_shadows.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world, !r_shadow_realtime_world.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_dlightshadows, !r_shadow_realtime_world_dlightshadows.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_lightmaps, bound(0, r_shadow_realtime_world_lightmaps.value + dir * 0.1, 1));
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_shadows, !r_shadow_realtime_world_shadows.integer);
+}
+
+
+void M_Options_Graphics_Draw (void)
+{
+ int visible;
+ cachepic_t *p;
+
+ M_Background(320, 200);
+
+ M_DrawPic(16, 4, "gfx/qplaque.lmp");
+ p = Draw_CachePic("gfx/p_option.lmp");
+ M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp");
+
+ optcursor = options_graphics_cursor;
+ optnum = 0;
+ visible = (vid.conheight - 32) / 8;
+ opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_GRAPHICS_ITEMS - visible)) * 8;
+
+ M_Options_PrintSlider( " Gloss Mode", true, r_shadow_gloss.integer, 0, 2);
+ M_Options_PrintCheckbox(" RT DLights", true, r_shadow_realtime_dlight.integer);
+ M_Options_PrintCheckbox(" RT DLight Shadows", true, r_shadow_realtime_dlight_shadows.integer);
+ M_Options_PrintCheckbox(" RT World", true, r_shadow_realtime_world.integer);
+ M_Options_PrintCheckbox("RT World DLight Shadows", true, r_shadow_realtime_world_dlightshadows.integer);
+ M_Options_PrintSlider( " RT World Lightmaps", true, r_shadow_realtime_world_lightmaps.value, 0, 1);
+ M_Options_PrintCheckbox(" RT World Shadow", true, r_shadow_realtime_world_shadows.integer);
+}
+
+
+void M_Options_Graphics_Key (int k, char ascii)
+{
+ switch (k)
+ {
+ case K_ESCAPE:
+ M_Menu_Options_f ();
+ break;
+
+ case K_ENTER:
+ M_Menu_Options_Graphics_AdjustSliders (1);
+ break;
+
+ case K_UPARROW:
+ S_LocalSound ("sound/misc/menu1.wav");
+ options_graphics_cursor--;
+ if (options_graphics_cursor < 0)
+ options_graphics_cursor = OPTIONS_GRAPHICS_ITEMS-1;
+ break;
+
+ case K_DOWNARROW:
+ S_LocalSound ("sound/misc/menu1.wav");
+ options_graphics_cursor++;
+ if (options_graphics_cursor >= OPTIONS_GRAPHICS_ITEMS)
+ options_graphics_cursor = 0;
+ break;
+
+ case K_LEFTARROW:
+ M_Menu_Options_Graphics_AdjustSliders (-1);
+ break;
+
+ case K_RIGHTARROW:
+ M_Menu_Options_Graphics_AdjustSliders (1);
+ break;
+ }
+}