/* ================ VID_MenuDraw ================ */ static void VID_MenuDraw (void) { int i, y; qpic_t *p; const char *title; y = 4; // plaque p = Draw_CachePic ("gfx/qplaque.lmp"); M_DrawTransPic (16, y, p); //p = Draw_CachePic ("gfx/vidmodes.lmp"); p = Draw_CachePic ("gfx/p_option.lmp"); M_DrawPic ( (320-p->width)/2, y, p); y += 28; // title title = "Video Options"; M_PrintWhite ((320-8*strlen(title))/2, y, title); y += 16; // options for (i = 0; i < VIDEO_OPTIONS_ITEMS; i++) { switch (i) { case VID_OPT_MODE: M_Print (16, y, " Video mode"); M_Print (184, y, va("%ix%i", (int)vid_width.value, (int)vid_height.value)); break; case VID_OPT_BPP: M_Print (16, y, " Color depth"); M_Print (184, y, va("%i", (int)vid_bpp.value)); break; case VID_OPT_FULLSCREEN: M_Print (16, y, " Fullscreen"); M_DrawCheckbox (184, y, (int)vid_fullscreen.value); break; case VID_OPT_VSYNC: M_Print (16, y, " Vertical sync"); if (gl_swap_control) M_DrawCheckbox (184, y, (int)vid_vsync.value); else M_Print (184, y, "N/A"); break; case VID_OPT_TEST: y += 8; //separate the test and apply items M_Print (16, y, " Test changes"); break; case VID_OPT_APPLY: M_Print (16, y, " Apply changes"); break; } if (video_options_cursor == i) M_DrawCharacter (168, y, 12+((int)(realtime*4)&1)); y += 8; } }
static void VR_MenuPrintOptionValue(int cx, int cy, int option) { char value_buffer[16] = {0}; const char *value_string = NULL; #ifdef _MSC_VER #define snprintf sprintf_s #endif switch ( option ) { default: break; case VR_OPTION_ENABLED: M_DrawCheckbox( cx, cy, (int)vr_enabled.value ); break; case VR_OPTION_PERFHUD: if (vr_perfhud.value == 1) value_string = "Latency Timing"; else if (vr_perfhud.value == 2) value_string = "Render Timing"; else if (vr_perfhud.value == 3) value_string = "Perf Headroom"; else if (vr_perfhud.value == 4) value_string = "Version Info"; else value_string = "off"; break; case VR_OPTION_AIMMODE: switch ( (int)vr_aimmode.value ) { case VR_AIMMODE_HEAD_MYAW: value_string = "HEAD_MYAW"; break; case VR_AIMMODE_HEAD_MYAW_MPITCH: value_string = "HEAD_MYAW_MPITCH"; break; case VR_AIMMODE_MOUSE_MYAW: value_string = "MOUSE_MYAW"; break; case VR_AIMMODE_MOUSE_MYAW_MPITCH: value_string = "MOUSE_MYAW_MPITCH"; break; default: case VR_AIMMODE_BLENDED: value_string = "BLENDED"; break; case VR_AIMMODE_BLENDED_NOPITCH: value_string = "BLENDED_NOPITCH"; break; } break; case VR_OPTION_DEADZONE: if ( vr_deadzone.value > 0 ) { snprintf( value_buffer, sizeof(value_buffer), "%.0f degrees", vr_deadzone.value ); value_string = value_buffer; } else { value_string = "off"; } break; case VR_OPTION_CROSSHAIR: if ( (int)vr_crosshair.value == 2 ) { value_string = "line"; } else if ( (int)vr_crosshair.value == 1 ) { value_string = "point"; } else { value_string = "off"; } break; case VR_OPTION_CROSSHAIR_DEPTH: if ( vr_crosshair_depth.value > 0 ) { snprintf( value_buffer, sizeof(value_buffer), "%.0f units", vr_crosshair_depth.value ); value_string = value_buffer; } else { value_string = "off"; } break; case VR_OPTION_CROSSHAIR_SIZE: if ( vr_crosshair_size.value > 0 ) { snprintf( value_buffer, sizeof(value_buffer), "%.0f pixels", vr_crosshair_size.value ); value_string = value_buffer; } else { value_string = "off"; } break; case VR_OPTION_CROSSHAIR_ALPHA: M_DrawSlider( cx, cy, vr_crosshair_alpha.value ); break; } #ifdef _MSC_VER #undef snprintf #endif if ( value_string ) { M_Print( cx, cy, value_string ); } }