static void EffectsSetMenuItemValues(void) { Cvar_SetValue("cl_blood", ClampCvar(0, 4, Cvar_VariableValue("cl_blood"))); s_options_effects_blood_box.curvalue = Cvar_VariableValue("cl_blood"); Cvar_SetValue("cl_old_explosions", ClampCvar(0, 1, Cvar_VariableValue("cl_old_explosions"))); s_options_effects_oldexplosions_box.curvalue = Cvar_VariableValue("cl_old_explosions"); Cvar_SetValue("cl_plasma_explo_sound", ClampCvar(0, 1, Cvar_VariableValue("cl_plasma_explo_sound"))); s_options_effects_plasmaexplosound_box.curvalue = Cvar_VariableValue("cl_plasma_explo_sound"); Cvar_SetValue("cl_item_bobbing", ClampCvar(0, 1, Cvar_VariableValue("cl_item_bobbing"))); s_options_effects_itembob_box.curvalue = Cvar_VariableValue("cl_item_bobbing"); Cvar_SetValue("r_decals", ClampCvar(0, 1000, Cvar_VariableValue("r_decals"))); s_options_effects_decal_slider.curvalue = Cvar_VariableValue("r_decals") / 50; Cvar_SetValue("cl_particle_scale", ClampCvar(0, 5, Cvar_VariableValue("cl_particle_scale"))); s_options_effects_particle_comp_slider.curvalue = (Cvar_VariableValue("cl_particle_scale") - 3) * -1 + 3; Cvar_SetValue("cl_railtype", ClampCvar(0, 2, Cvar_VariableValue("cl_railtype"))); s_options_effects_railtrail_box.curvalue = Cvar_VariableValue("cl_railtype"); s_options_effects_railcolor_slider[0].curvalue = Cvar_VariableValue("cl_railred") / 16; s_options_effects_railcolor_slider[1].curvalue = Cvar_VariableValue("cl_railgreen") / 16; s_options_effects_railcolor_slider[2].curvalue = Cvar_VariableValue("cl_railblue") / 16; Cvar_SetValue("cl_footstep_override", ClampCvar(0, 1, Cvar_VariableValue("cl_footstep_override"))); s_options_effects_footstep_box.curvalue = Cvar_VariableValue("cl_footstep_override"); }
static void ScreenSetMenuItemValues( void ) { Cvar_SetValue( "crosshair", ClampCvar( 0, 100, Cvar_VariableValue("crosshair") ) ); //s_options_crosshair_box.curvalue = Cvar_VariableValue("crosshair"); SetCrosshairCursor(); Cvar_SetValue( "crosshair_scale", ClampCvar( 0.25, 3, Cvar_VariableValue("crosshair_scale") ) ); s_options_screen_crosshairscale_slider.curvalue = Cvar_VariableValue("crosshair_scale")*4; Cvar_SetValue( "crosshair_alpha", ClampCvar( 0.05, 1, Cvar_VariableValue("crosshair_alpha") ) ); s_options_screen_crosshairalpha_slider.curvalue = Cvar_VariableValue("crosshair_alpha")*20; Cvar_SetValue( "crosshair_pulse", ClampCvar( 0, 0.5, Cvar_VariableValue("crosshair_pulse") ) ); s_options_screen_crosshairpulse_slider.curvalue = Cvar_VariableValue("crosshair_pulse")*20; Cvar_SetValue( "hud_scale", ClampCvar( 0, 7, Cvar_VariableValue("hud_scale") ) ); s_options_screen_hudscale_slider.curvalue = Cvar_VariableValue("hud_scale")+1; Cvar_SetValue( "hud_alpha", ClampCvar( 0, 1, Cvar_VariableValue("hud_alpha") ) ); s_options_screen_hudalpha_slider.curvalue = Cvar_VariableValue("hud_alpha")*10 + 1; Cvar_SetValue( "hud_squeezedigits", ClampCvar( 0, 1, Cvar_VariableValue("hud_squeezedigits") ) ); s_options_screen_hudsqueezedigits_box.curvalue = Cvar_VariableValue("hud_squeezedigits"); Cvar_SetValue( "cl_drawfps", ClampCvar( 0, 1, Cvar_VariableValue("cl_drawfps") ) ); s_options_screen_fps_box.curvalue = Cvar_VariableValue("cl_drawfps"); }
static void IngameSetMenuItemValues( void ) { SetCrosshairCursor(); Cvar_SetValue( "crosshair", ClampCvar( 0, 100, Cvar_VariableValue("crosshair") ) ); //s_options_crosshair_box.curvalue = Cvar_VariableValue("crosshair"); s_options_ingame_crosshairscale_slider.curvalue = Cvar_VariableValue("crosshair_scale")*4; Cvar_SetValue( "hud_scale", ClampCvar( 0, 7, Cvar_VariableValue("hud_scale") ) ); s_options_ingame_hudscale_slider.curvalue = Cvar_VariableValue("hud_scale")+1; Cvar_SetValue( "hud_alpha", ClampCvar( 0, 1, Cvar_VariableValue("hud_alpha") ) ); s_options_ingame_hudalpha_slider.curvalue = Cvar_VariableValue("hud_alpha")*10 + 1; Cvar_SetValue( "cl_drawfps", ClampCvar( 0, 1, Cvar_VariableValue("cl_drawfps") ) ); s_options_ingame_fps_box.curvalue = Cvar_VariableValue("cl_drawfps"); Cvar_SetValue( "cl_footstep_override", ClampCvar( 0, 1, Cvar_VariableValue("cl_footstep_override") ) ); s_options_ingame_footstep_box.curvalue = Cvar_VariableValue("cl_footstep_override"); Cvar_SetValue( "cl_blood", ClampCvar( 0, 4, Cvar_VariableValue("cl_blood") ) ); s_options_ingame_blood_box.curvalue = Cvar_VariableValue("cl_blood"); Cvar_SetValue( "cl_railtype", ClampCvar( 0, 2, Cvar_VariableValue("cl_railtype") ) ); s_options_ingame_railtrail_box.curvalue = Cvar_VariableValue("cl_railtype"); s_options_ingame_railcolor_box[0].curvalue = Cvar_VariableValue("cl_railred")/16; s_options_ingame_railcolor_box[1].curvalue = Cvar_VariableValue("cl_railgreen")/16; s_options_ingame_railcolor_box[2].curvalue = Cvar_VariableValue("cl_railblue")/16; }
static void NeckmodelFunc ( void *unused ) { float temp; char string[6]; temp = ClampCvar(0,1,atof(s_options_vr_advanced_neckmodel_up_field.buffer)); strncpy(string, va("%.3f",temp), sizeof(string)); Cvar_Set("vr_neckmodel_up", string); temp = ClampCvar(0,1,atof(s_options_vr_advanced_neckmodel_forward_field.buffer)); strncpy(string, va("%.3f",temp), sizeof(string)); Cvar_Set("vr_neckmodel_forward", string); strcpy( s_options_vr_advanced_neckmodel_up_field.buffer, vr_neckmodel_up->string ); s_options_vr_advanced_neckmodel_up_field.cursor = strlen( vr_neckmodel_up->string ); strcpy( s_options_vr_advanced_neckmodel_forward_field.buffer, vr_neckmodel_forward->string ); s_options_vr_advanced_neckmodel_forward_field.cursor = strlen( vr_neckmodel_forward->string ); }
static void CustomPredictionFunc(void *unused) { float temp; temp = ClampCvar(0,75,atof(s_options_vr_advanced_prediction_field.buffer)); Cvar_SetInteger("vr_prediction",temp); strcpy( s_options_vr_advanced_prediction_field.buffer, vr_prediction->string ); s_options_vr_advanced_prediction_field.cursor = strlen( vr_prediction->string ); }
static void SetMenuItemValues( void ) { s_options_list.curvalue = curmenu; /* -------------------------------- */ /* console menu */ Cvar_SetValue( "con_notifyfade", ClampCvar( 0, 1, con_notifyfade->value ) ); s_console_notfade_box.curvalue = con_notifyfade->value; s_console_notlines_slider.curvalue = con_notifylines->value; s_console_alpha_slider.curvalue = con_alpha->value * 10; s_console_drop_slider.curvalue = scr_conheight->value * 10; s_console_scroll_slider.curvalue = con_scrlines->value; /* -------------------------------- */ /* crosshair menu */ Cvar_SetValue( "crosshair", ClampCvar( 0, 8, crosshair->value ) ); s_crosshair_number_box.curvalue = crosshair->value; s_crosshair_alpha_slider.curvalue = ch_alpha->value*10; s_crosshair_pulse_slider.curvalue = ch_pulse->value*10; s_crosshair_scale_slider.curvalue = ch_scale->value*10; s_crosshair_red_slider.curvalue = ch_red->value*10; s_crosshair_green_slider.curvalue = ch_green->value*10; s_crosshair_blue_slider.curvalue = ch_blue->value*10; /* -------------------------------- */ /* misc menu */ Cvar_SetValue( "cl_clock", ClampCvar( 0, 2, cl_clock->value ) ); s_misc_showclock_box.curvalue = cl_clock->value; Cvar_SetValue( "cl_fps", ClampCvar( 0, 2, cl_fps->value ) ); s_misc_showfps_box.curvalue = cl_fps->value; Cvar_SetValue( "cl_chathud", ClampCvar( 0, 2, cl_chathud->value ) ); s_misc_showchat_box.curvalue = cl_chathud->value; Cvar_SetValue( "cl_maptime", ClampCvar( 0, 2, cl_maptime->value ) ); s_misc_showtime_box.curvalue = cl_maptime->value; Cvar_SetValue( "cl_timestamps", ClampCvar( 0, 2, cl_timestamps->value ) ); s_misc_timestamp_box.curvalue = cl_timestamps->value; Cvar_SetValue( "cl_hudalpha", ClampCvar( 0, 1, cl_hudalpha->value ) ); s_misc_hudalpha_slider.curvalue = cl_hudalpha->value*10; }
static void InterfaceSetMenuItemValues( void ) { SetFontCursor(); s_options_interface_menumouse_slider.curvalue = ( Cvar_VariableValue("menu_sensitivity") ) * 4; s_options_interface_menualpha_slider.curvalue = ( Cvar_VariableValue("menu_alpha") ) * 20; s_options_interface_fontsize_slider.curvalue = ( Cvar_VariableValue("con_font_size") ) * 0.25; Cvar_SetValue( "alt_text_color", ClampCvar( 0, 9, Cvar_VariableValue("alt_text_color") ) ); s_options_interface_alt_text_color_box.curvalue = Cvar_VariableValue("alt_text_color"); Cvar_SetValue( "con_alpha", ClampCvar( 0, 1, Cvar_VariableValue("con_alpha") ) ); s_options_interface_conalpha_slider.curvalue = ( Cvar_VariableValue("con_alpha") ) * 20; //Cvar_SetValue( "con_height", ClampCvar( 0.25, 0.75, Cvar_VariableValue("con_height") ) ); //s_options_interface_conheight_slider.curvalue = 20 * (Cvar_VariableValue("con_height") - 0.25); s_options_interface_noalttab_box.curvalue = Cvar_VariableValue("win_noalttab"); }
static void IPDFunc( void *unused ) { float temp; char string[6]; temp = ClampCvar(0,100,atof(s_options_vr_ipd_field.buffer)); strncpy(string, va("%.2f",temp), sizeof(string)); Cvar_Set("vr_ipd", string); strcpy( s_options_vr_ipd_field.buffer, vr_ipd->string ); s_options_vr_ipd_field.cursor = strlen( vr_ipd->string ); }
static void DeadzoneFunc ( void *unused ) { float temp; temp = ClampCvar(0,360,atof(s_options_vr_aimmode_deadzone_pitch_field.buffer)); Cvar_SetInteger("vr_aimmode_deadzone_pitch",temp); temp = ClampCvar(0,360,atof(s_options_vr_aimmode_deadzone_yaw_field.buffer)); Cvar_SetInteger("vr_aimmode_deadzone_yaw",temp); temp = ClampCvar(0,360,atof(s_options_vr_hud_deadzone_yaw_field.buffer)); Cvar_SetInteger("vr_hud_deadzone_yaw",temp); strcpy( s_options_vr_aimmode_deadzone_pitch_field.buffer, vr_aimmode_deadzone_pitch->string ); s_options_vr_aimmode_deadzone_pitch_field.cursor = strlen( vr_aimmode_deadzone_pitch->string ); strcpy( s_options_vr_aimmode_deadzone_yaw_field.buffer, vr_aimmode_deadzone_yaw->string ); s_options_vr_aimmode_deadzone_yaw_field.cursor = strlen( vr_aimmode_deadzone_yaw->string ); strcpy( s_options_vr_hud_deadzone_yaw_field.buffer, vr_hud_deadzone_yaw->string ); s_options_vr_hud_deadzone_yaw_field.cursor = strlen( vr_hud_deadzone_yaw->string ); }
float GetAnisoCurValue () { float aniso_avail = Cvar_VariableValue("gl_anisotropic_avail"); float anisoValue = ClampCvar (0, aniso_avail, Cvar_VariableValue("gl_anisotropic")); if (aniso_avail == 0) // not available return 0; if (anisoValue < 2.0) return 0; else if (anisoValue < 4.0) return 1; else if (anisoValue < 8.0) return 2; else if (anisoValue < 16.0) return 3; else // >= 16.0 return 4; }
static void VRSetMenuItemValues( void ) { s_options_vr_aimmode_box.curvalue = ( Cvar_VariableValue("vr_aimmode") ); s_options_vr_viewmove_box.curvalue = ( Cvar_VariableValue("vr_viewmove") ); s_options_vr_autoipd_box.curvalue = ( Cvar_VariableValue("vr_autoipd") ); strcpy( s_options_vr_aimmode_deadzone_pitch_field.buffer, vr_aimmode_deadzone_pitch->string ); s_options_vr_aimmode_deadzone_pitch_field.cursor = strlen( vr_aimmode_deadzone_pitch->string ); strcpy( s_options_vr_aimmode_deadzone_yaw_field.buffer, vr_aimmode_deadzone_yaw->string ); s_options_vr_aimmode_deadzone_yaw_field.cursor = strlen( vr_aimmode_deadzone_yaw->string ); strcpy( s_options_vr_hud_deadzone_yaw_field.buffer, vr_hud_deadzone_yaw->string ); s_options_vr_hud_deadzone_yaw_field.cursor = strlen( vr_hud_deadzone_yaw->string ); strcpy( s_options_vr_ipd_field.buffer, vr_ipd->string ); s_options_vr_ipd_field.cursor = strlen( vr_ipd->string ); s_options_vr_walkspeed_slider.curvalue = (int) (( ClampCvar(0.5,1.5, Cvar_VariableValue("vr_walkspeed")) - 0.5) * 10.0); s_options_vr_laser_box.curvalue = ( Cvar_VariableInteger("vr_aimlaser") ); s_options_vr_hud_fixed_box.curvalue = ( Cvar_VariableInteger("vr_hud_fixed") ); }
void StartServerActionFunc( void *self ) { char startmap[1024]; int timelimit; int fraglimit; int maxclients; char *spot; // strcpy( startmap, strchr( mapnames[maplist.curvalue], '\n' ) + 1 ); strcpy( startmap, mapnames[maplist.curvalue]); maxclients = atoi( s_maxclients_field.buffer ); timelimit = atoi( s_timelimit_field.buffer ); fraglimit = atoi( s_fraglimit_field.buffer ); Cvar_SetLatched( "maxclients", va("%i", (int)ClampCvar( 0, maxclients, maxclients )) ); Cvar_SetValue ("timelimit", ClampCvar( 0, timelimit, timelimit ) ); Cvar_SetValue ("fraglimit", ClampCvar( 0, fraglimit, fraglimit ) ); Cvar_Set("hostname", s_hostname_field.buffer ); // Cvar_SetValue ("deathmatch", !s_rules_box.curvalue ); // Cvar_SetValue ("coop", s_rules_box.curvalue ); //PGM if((s_rules_box.curvalue < 2) || (Developer_searchpath() != 2)) { Cvar_SetLatched ("deathmatch", s_rules_box.curvalue ? "0" : "1"); Cvar_SetLatched ("coop", s_rules_box.curvalue ? "1" : "0" ); Cvar_SetValue ("gamerules", 0 ); } else { Cvar_SetLatched ("deathmatch", "1"); // deathmatch is always true for rogue games, right? Cvar_SetLatched ("coop", "0"); // FIXME - this might need to depend on which game we're running Cvar_SetValue ("gamerules", s_rules_box.curvalue); } //PGM spot = NULL; if (s_rules_box.curvalue == 1) // PGM { if(Q_stricmp(startmap, "bunk1") == 0) spot = "start"; else if(Q_stricmp(startmap, "mintro") == 0) spot = "start"; else if(Q_stricmp(startmap, "fact1") == 0) spot = "start"; else if(Q_stricmp(startmap, "power1") == 0) spot = "pstart"; else if(Q_stricmp(startmap, "biggun") == 0) spot = "bstart"; else if(Q_stricmp(startmap, "hangar1") == 0) spot = "unitstart"; else if(Q_stricmp(startmap, "city1") == 0) spot = "unitstart"; else if(Q_stricmp(startmap, "boss1") == 0) spot = "bosstart"; } if (spot) { if (Com_ServerState()) Cbuf_AddText ("disconnect\n"); Cbuf_AddText (va("gamemap \"*%s$%s\"\n", startmap, spot)); } else { Cbuf_AddText (va("map %s\n", startmap)); } M_ForceMenuOff (); }
/* ================ Menu_Video_Init ================ */ void Menu_Video_Init (void) { // Knightmare- added 1280x1024, 1400x1050, 856x480, 1024x480 modes, removed 320x240, 400x300, 512x384 modes static const char *resolutions[] = { "[640x480 ]", "[800x600 ]", "[1024x768 ]", "[1280x960 ]", "[1280x1024]", // Knightmare added "[1600x1200]", "[1280x720 ]", // Knightmare added "[1280x768 ]", // Knightmare added "[1280x800 ]", // Knightmare added "[1360x768 ]", // Knightmare added "[1366x768 ]", // Knightmare added "[1440x900 ]", // Knightmare added "[1600x900 ]", // Knightmare added "[1680x1050]", // Knightmare added "[1920x1080]", // Knightmare added "[1920x1200]", // Knightmare added "[2560x1440]", // Knightmare added "[2560x1600]", // Knightmare added "[custom ]", 0 }; static const char *refreshrate_names[] = { "[default]", "[60Hz ]", "[70Hz ]", "[72Hz ]", "[75Hz ]", "[85Hz ]", "[100Hz ]", "[110Hz ]", "[120Hz ]", "[150Hz ]", 0 }; static const char *yesno_names[] = { "no", "yes", 0 }; static const char *sync_names[] = { "no", "vsync", "late frame", 0 }; static const char *mip_names[] = { "bilinear", "trilinear", 0 }; static const char *lmh_names[] = { "low", "medium", "high", "highest", 0 }; static const char *vsync_names[] = { "no", "yes", "adaptive", 0 }; static const char *antialias_names[] = { "off", "4x SSAA", "FXAA", "FXAA FSS", 0 }; static const char *compression_names[] = { "off", "low quality", "high quality", 0 }; int32_t y = 0; float temp; int32_t i; // int32_t j = sizeof(vid_modes) / sizeof(vidmode_t); for (i = 0; i < NUM_VIDEO_MODES; i++) { if (vid_modes[i].width == Cvar_VariableInteger("vid_width") && vid_modes[i].height == Cvar_VariableInteger("vid_height") ) break; } temp = i; if ( !con_font_size ) con_font_size = Cvar_Get ("con_font_size", "8", CVAR_ARCHIVE); s_video_menu.x = SCREEN_WIDTH*0.5; // s_video_menu.x = viddef.width * 0.50; s_video_menu.y = SCREEN_HEIGHT*0.5 - 80; s_video_menu.nitems = 0; s_mode_list.generic.type = MTYPE_SPINCONTROL; s_mode_list.generic.name = "video mode"; s_mode_list.generic.x = 0; s_mode_list.generic.y = y; s_mode_list.itemnames = resolutions; s_mode_list.curvalue = temp; // offset for getting rid of < 640x480 resolutions s_mode_list.generic.statusbar = "changes screen resolution"; if (glConfig.ext_framebuffer_object) { s_antialias_box.generic.type = MTYPE_SPINCONTROL; s_antialias_box.generic.x = 0; s_antialias_box.generic.y = y += MENU_LINE_SIZE; s_antialias_box.generic.name = "anti-aliasing"; s_antialias_box.generic.callback = AntialiasCallback; s_antialias_box.curvalue = Cvar_VariableInteger("r_antialias"); s_antialias_box.itemnames = antialias_names; s_antialias_box.generic.statusbar = "selects a software post-processing antialiasing technique"; } s_fs_box.generic.type = MTYPE_SPINCONTROL; s_fs_box.generic.x = 0; s_fs_box.generic.y = y += MENU_LINE_SIZE; s_fs_box.generic.name = "fullscreen"; s_fs_box.itemnames = yesno_names; s_fs_box.curvalue = Cvar_VariableValue("vid_fullscreen"); s_fs_box.generic.statusbar = "changes bettween fullscreen and windowed display"; s_brightness_slider.generic.type = MTYPE_SLIDER; s_brightness_slider.generic.x = 0; s_brightness_slider.generic.y = y += 2 * MENU_LINE_SIZE; s_brightness_slider.generic.name = "brightness"; s_brightness_slider.generic.callback = BrightnessCallback; s_brightness_slider.minvalue = 0; s_brightness_slider.maxvalue = 20; s_brightness_slider.curvalue = Cvar_VariableValue("vid_brightness") * 20.0f; s_brightness_slider.generic.statusbar = "changes display brightness"; s_texfilter_box.generic.type = MTYPE_SPINCONTROL; s_texfilter_box.generic.x = 0; s_texfilter_box.generic.y = y += 2*MENU_LINE_SIZE; s_texfilter_box.generic.name = "texture filter"; s_texfilter_box.curvalue = texfilter_box_setval(); s_texfilter_box.itemnames = mip_names; s_texfilter_box.generic.statusbar = "changes texture filtering mode"; s_aniso_box.generic.type = MTYPE_SPINCONTROL; s_aniso_box.generic.x = 0; s_aniso_box.generic.y = y += MENU_LINE_SIZE; s_aniso_box.generic.name = "anisotropic filter"; s_aniso_box.curvalue = GetAnisoCurValue(); s_aniso_box.itemnames = GetAnisoNames(); s_aniso_box.generic.statusbar = "changes level of anisotropic mipmap filtering"; s_texqual_box.generic.type = MTYPE_SPINCONTROL; s_texqual_box.generic.x = 0; s_texqual_box.generic.y = y += MENU_LINE_SIZE; s_texqual_box.generic.name = "texture quality"; s_texqual_box.curvalue = ClampCvar (0, 3, 3-Cvar_VariableValue("r_picmip")); s_texqual_box.itemnames = lmh_names; s_texqual_box.generic.statusbar = "changes maximum texture size (highest = no limit)"; if (glConfig.ext_texture_compression_s3tc || glConfig.arb_texture_compression_bptc) { s_texcompress_box.generic.type = MTYPE_SPINCONTROL; s_texcompress_box.generic.x = 0; s_texcompress_box.generic.y = y += MENU_LINE_SIZE; s_texcompress_box.generic.name = "texture compression"; s_texcompress_box.itemnames = compression_names; s_texcompress_box.curvalue = ClampCvar(0,2,Cvar_VariableValue("r_texturecompression")); s_texcompress_box.generic.statusbar = "enables texture compression"; } s_vsync_box.generic.type = MTYPE_SPINCONTROL; s_vsync_box.generic.x = 0; s_vsync_box.generic.y = y += 2*MENU_LINE_SIZE; s_vsync_box.generic.name = "video sync"; s_vsync_box.generic.callback = VsyncCallback; if (glConfig.ext_swap_control_tear) { int32_t temp = !!Cvar_VariableInteger("r_swapinterval"); temp += temp ? !!Cvar_VariableInteger("r_adaptivevsync") : 0; s_vsync_box.curvalue = temp; s_vsync_box.itemnames = vsync_names; } else { s_vsync_box.curvalue = !!Cvar_VariableValue("r_swapinterval"); s_vsync_box.itemnames = yesno_names; } s_vsync_box.generic.statusbar = "sync framerate with monitor refresh"; if (glConfig.arb_sync) { s_fencesync_box.generic.type = MTYPE_SPINCONTROL; s_fencesync_box.generic.x = 0; s_fencesync_box.generic.y = y += MENU_LINE_SIZE; s_fencesync_box.generic.name = "gpu frame pacing"; s_fencesync_box.generic.callback = FenceSyncCallback; s_fencesync_box.curvalue = ClampCvar(0,2, abs(Cvar_VariableInteger("r_fencesync"))); s_fencesync_box.itemnames = sync_names; s_fencesync_box.generic.statusbar = "forces the gpu to synchronize after monitor refresh"; } // Knightmare- refresh rate option s_refresh_box.generic.type = MTYPE_SPINCONTROL; s_refresh_box.generic.x = 0; s_refresh_box.generic.y = y += MENU_LINE_SIZE; s_refresh_box.generic.name = "refresh rate"; s_refresh_box.curvalue = refresh_box_setval(); s_refresh_box.itemnames = refreshrate_names; s_refresh_box.generic.statusbar = "sets refresh rate for fullscreen modes"; s_advanced_action.generic.type = MTYPE_ACTION; s_advanced_action.generic.name = "advanced options"; s_advanced_action.generic.x = 0; s_advanced_action.generic.y = y += 3*MENU_LINE_SIZE; s_advanced_action.generic.callback = AdvancedOptions; s_defaults_action.generic.type = MTYPE_ACTION; s_defaults_action.generic.name = "reset to defaults"; s_defaults_action.generic.x = 0; s_defaults_action.generic.y = y += 3*MENU_LINE_SIZE; s_defaults_action.generic.callback = ResetVideoDefaults; s_defaults_action.generic.statusbar = "resets all video settings to internal defaults"; // changed cancel to apply changes, thanx to MrG s_apply_action.generic.type = MTYPE_ACTION; s_apply_action.generic.name = "apply changes"; s_apply_action.generic.x = 0; s_apply_action.generic.y = y += 2*MENU_LINE_SIZE; s_apply_action.generic.callback = ApplyChanges; s_backmain_action.generic.type = MTYPE_ACTION; s_backmain_action.generic.name = "back to main"; s_backmain_action.generic.x = 0; s_backmain_action.generic.y = y += 2*MENU_LINE_SIZE; s_backmain_action.generic.callback = UI_BackMenu; Menu_AddItem( &s_video_menu, ( void * ) &s_mode_list ); if (glConfig.ext_framebuffer_object) Menu_AddItem( &s_video_menu, ( void * ) &s_antialias_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_fs_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_brightness_slider ); Menu_AddItem( &s_video_menu, ( void * ) &s_texfilter_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_aniso_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_texqual_box ); // Menu_AddItem( &s_video_menu, ( void * ) &s_npot_mipmap_box ); if (glConfig.ext_texture_compression_s3tc) Menu_AddItem( &s_video_menu, ( void * ) &s_texcompress_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_vsync_box ); if (glConfig.arb_sync) Menu_AddItem( &s_video_menu, ( void * ) &s_fencesync_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_refresh_box ); Menu_AddItem( &s_video_menu, ( void * ) &s_advanced_action ); Menu_AddItem( &s_video_menu, ( void * ) &s_defaults_action ); Menu_AddItem( &s_video_menu, ( void * ) &s_apply_action ); Menu_AddItem( &s_video_menu, ( void * ) &s_backmain_action ); // Menu_Center( &s_video_menu ); // s_video_menu.x -= MENU_FONT_SIZE; }
static void ApplyChanges( void *unused ) { int32_t temp; temp = ClampCvar(0,NUM_VIDEO_MODES,s_mode_list.curvalue); if (temp != NUM_VIDEO_MODES) { Cvar_SetValue( "vid_width", vid_modes[temp].width ); // offset for eliminating < 640x480 modes Cvar_SetValue( "vid_height", vid_modes[temp].height ); // offset for eliminating < 640x480 modes } Cvar_SetValue( "vid_fullscreen", s_fs_box.curvalue ); Cvar_SetValue( "vid_brightness", s_brightness_slider.curvalue/20.0f ); Cvar_SetValue( "r_picmip", 3-s_texqual_box.curvalue ); Cvar_SetValue( "r_texturecompression",s_texcompress_box.curvalue); // Knightmare- refesh rate option switch (s_refresh_box.curvalue) { case 9: Cvar_SetValue ("vid_refresh", 150); break; case 8: Cvar_SetValue ("vid_refresh", 120); break; case 7: Cvar_SetValue ("vid_refresh", 110); break; case 6: Cvar_SetValue ("vid_refresh", 100); break; case 5: Cvar_SetValue ("vid_refresh", 85); break; case 4: Cvar_SetValue ("vid_refresh", 75); break; case 3: Cvar_SetValue ("vid_refresh", 72); break; case 2: Cvar_SetValue ("vid_refresh", 70); break; case 1: Cvar_SetValue ("vid_refresh", 60); break; case 0: default: Cvar_SetValue ("vid_refresh", 0); break; } if (s_texfilter_box.curvalue == 0) Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_NEAREST"); else if (s_texfilter_box.curvalue == 1) Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR"); switch ((int32_t)s_aniso_box.curvalue) { case 1: Cvar_SetValue( "r_anisotropic", 2.0 ); break; case 2: Cvar_SetValue( "r_anisotropic", 4.0 ); break; case 3: Cvar_SetValue( "r_anisotropic", 8.0 ); break; case 4: Cvar_SetValue( "r_anisotropic", 16.0 ); break; default: case 0: Cvar_SetValue( "r_anisotropic", 0.0 ); break; } VsyncCallback(NULL); // FenceSyncCallback(NULL); // AntialiasCallback(NULL); // Cvar_SetValue( "r_swapinterval", s_vsync_box.curvalue ); prepareVideoRefresh (); //UI_ForceMenuOff(); }
//Knightmare- init client compatibility menu option static void JoinserverSetMenuItemValues( void ) { Cvar_SetValue( "cl_servertrick", ClampCvar( 0, 1, Cvar_VariableValue("cl_servertrick") ) ); s_joinserver_compatibility_box.curvalue = Cvar_VariableValue("cl_servertrick"); }
static void Video_Advanced_MenuSetValues ( void ) { char *sshotformat; Cvar_SetValue( "r_modulate", ClampCvar( 1, 2, Cvar_VariableValue("r_modulate") ) ); s_lightmapscale_slider.curvalue = (Cvar_VariableValue("r_modulate") -1) * 10; Cvar_SetValue( "r_intensity", ClampCvar( 1, 2, Cvar_VariableValue("r_intensity") ) ); s_textureintensity_slider.curvalue = (Cvar_VariableValue("r_intensity") -1) * 10; Cvar_SetValue( "r_rgbscale", ClampCvar( 1, 2, Cvar_VariableValue("r_rgbscale") ) ); if (Cvar_VariableValue("r_rgbscale") == 1) s_rgbscale_box.curvalue = 0; else s_rgbscale_box.curvalue = 1; Cvar_SetValue( "r_trans_lighting", ClampCvar( 0, 2, Cvar_VariableValue("r_trans_lighting") ) ); s_trans_lighting_box.curvalue = Cvar_VariableValue("r_trans_lighting"); Cvar_SetValue( "r_warp_lighting", ClampCvar( 0, 1, Cvar_VariableValue("r_warp_lighting") ) ); s_warp_lighting_box.curvalue = Cvar_VariableValue("r_warp_lighting"); Cvar_SetValue( "r_lightcutoff", ClampCvar( 0, 64, Cvar_VariableValue("r_lightcutoff") ) ); s_lightcutoff_slider.curvalue = Cvar_VariableValue("r_lightcutoff") / 8.0f; Cvar_SetValue( "r_glass_envmaps", ClampCvar( 0, 1, Cvar_VariableValue("r_glass_envmaps") ) ); s_glass_envmap_box.curvalue = Cvar_VariableValue("r_glass_envmaps"); Cvar_SetValue( "r_solidalpha", ClampCvar( 0, 1, Cvar_VariableValue("r_solidalpha") ) ); s_solidalpha_box.curvalue = Cvar_VariableValue("r_solidalpha"); Cvar_SetValue( "r_pixel_shader_warp", ClampCvar( 0, 1, Cvar_VariableValue("r_pixel_shader_warp") ) ); s_texshader_warp_box.curvalue = Cvar_VariableValue("r_pixel_shader_warp"); Cvar_SetValue( "r_waterwave", ClampCvar( 0, 24, Cvar_VariableValue("r_waterwave") ) ); s_waterwave_slider.curvalue = Cvar_VariableValue("r_waterwave"); Cvar_SetValue( "r_caustics", ClampCvar( 0, 2, Cvar_VariableValue("r_caustics") ) ); s_caustics_box.curvalue = Cvar_VariableValue("r_caustics"); Cvar_SetValue( "r_particle_overdraw", ClampCvar( 0, 1, Cvar_VariableValue("r_particle_overdraw") ) ); s_particle_overdraw_box.curvalue = Cvar_VariableValue("r_particle_overdraw"); Cvar_SetValue( "r_bloom", ClampCvar( 0, 1, Cvar_VariableValue("r_bloom") ) ); s_lightbloom_box.curvalue = Cvar_VariableValue("r_bloom"); Cvar_SetValue( "r_model_shading", ClampCvar( 0, 3, Cvar_VariableValue("r_model_shading") ) ); s_modelshading_box.curvalue = Cvar_VariableValue("r_model_shading"); Cvar_SetValue( "r_shadows", ClampCvar( 0, 3, Cvar_VariableValue("r_shadows") ) ); s_shadows_box.curvalue = Cvar_VariableValue("r_shadows"); Cvar_SetValue( "r_stencilTwoSide", ClampCvar( 0, 1, Cvar_VariableValue("r_stencilTwoSide") ) ); s_two_side_stencil_box.curvalue = Cvar_VariableValue("r_stencilTwoSide"); Cvar_SetValue( "r_shelltype", ClampCvar( 0, 2, Cvar_VariableValue("r_shelltype") ) ); s_ent_shell_box.curvalue = Cvar_VariableValue("r_shelltype"); // Cvar_SetValue( "r_screenshot_jpeg", ClampCvar( 0, 1, Cvar_VariableValue("r_screenshot_jpeg") ) ); // s_screenshotjpeg_box.curvalue = Cvar_VariableValue("r_screenshot_jpeg"); sshotformat = Cvar_VariableString("r_screenshot_format"); if ( !Q_strcasecmp(sshotformat, "jpg") ) s_screenshotformat_box.curvalue = 0; else if ( !Q_strcasecmp(sshotformat, "png") ) s_screenshotformat_box.curvalue = 1; else // tga s_screenshotformat_box.curvalue = 2; Cvar_SetValue( "r_screenshot_jpeg_quality", ClampCvar( 50, 100, Cvar_VariableValue("r_screenshot_jpeg_quality") ) ); s_screenshotjpegquality_slider.curvalue = (Cvar_VariableValue("r_screenshot_jpeg_quality") -50) / 5; Cvar_SetValue( "r_saveshotsize", ClampCvar( 0, 1, Cvar_VariableValue("r_saveshotsize") ) ); s_saveshotsize_box.curvalue = Cvar_VariableValue("r_saveshotsize"); }
static void VRSVRSetMenuItemValues( void ) { s_options_vr_svr_enable_box.curvalue = ( !! Cvar_VariableInteger("vr_svr_enable") ); s_options_vr_svr_distortion_box.curvalue = ( 3 - ClampCvar(0, 3, Cvar_VariableInteger("vr_svr_distortion")) ); }
// jkrige - anisotropic filtering static void TextureModeCallback( void *unused ) { s_texturemode_box.curvalue = ClampCvar( 0, 2 + re.GetMaxAnisotropic(), s_texturemode_box.curvalue); Cvar_SetValue( "gl_texturemode", s_texturemode_box.curvalue ); }