It's unnecessary and other Quake engines don't have it.
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
// this is the number of the default mode (640x480) in the list above
int video_resolutions_hardcoded_count = sizeof(video_resolutions_hardcoded) / sizeof(*video_resolutions_hardcoded) - 1;
-#define VIDEO_ITEMS 10
+#define VIDEO_ITEMS 9
static int video_cursor = 0;
-static int video_cursor_table[VIDEO_ITEMS] = {68, 88, 96, 104, 112, 120, 128, 136, 144, 152};
+static int video_cursor_table[VIDEO_ITEMS] = {68, 88, 96, 104, 112, 120, 128, 136, 144};
static int menu_video_resolution;
video_resolution_t *video_resolutions;
// Current and Proposed Resolution
M_Print(16, video_cursor_table[t] - 12, " Current Resolution");
- if (vid_supportrefreshrate && vid.mode.userefreshrate && vid.mode.fullscreen)
+ if (!vid_desktopfullscreen.integer && vid.mode.refreshrate && vid.mode.fullscreen) // FIXME read current mode instead of cvar
M_Print(220, video_cursor_table[t] - 12, va(vabuf, sizeof(vabuf), "%dx%d %.2fhz", vid.mode.width, vid.mode.height, vid.mode.refreshrate));
else
M_Print(220, video_cursor_table[t] - 12, va(vabuf, sizeof(vabuf), "%dx%d", vid.mode.width, vid.mode.height));
t++;
// Refresh Rate
- M_ItemPrint(16, video_cursor_table[t], " Use Refresh Rate", vid_supportrefreshrate);
- M_DrawCheckbox(220, video_cursor_table[t], vid_userefreshrate.integer);
- t++;
-
- // Refresh Rate
- M_ItemPrint(16, video_cursor_table[t], " Refresh Rate", vid_supportrefreshrate && vid_userefreshrate.integer);
+ M_ItemPrint(16, video_cursor_table[t], " Refresh Rate", vid_fullscreen.integer && !vid_desktopfullscreen.integer);
M_DrawSlider(220, video_cursor_table[t], vid_refreshrate.value, 50, 150);
t++;
}
else if (video_cursor == t++)
Cvar_SetValueQuick (&vid_samples, bound(1, vid_samples.value * (dir > 0 ? 2 : 0.5), 32));
- else if (video_cursor == t++)
- Cvar_SetValueQuick (&vid_userefreshrate, !vid_userefreshrate.integer);
else if (video_cursor == t++)
Cvar_SetValueQuick (&vid_refreshrate, bound(50, vid_refreshrate.value + dir, 150));
else if (video_cursor == t++)
Cvar_SetValueQuick(&vid_fullscreen, vid.mode.fullscreen);
Cvar_SetValueQuick(&vid_bitsperpixel, vid.mode.bitsperpixel);
Cvar_SetValueQuick(&vid_samples, vid.mode.samples);
- if (vid_supportrefreshrate)
- Cvar_SetValueQuick(&vid_refreshrate, vid.mode.refreshrate);
- Cvar_SetValueQuick(&vid_userefreshrate, vid.mode.userefreshrate);
+ Cvar_SetValueQuick(&vid_refreshrate, vid.mode.refreshrate);
S_LocalSound ("sound/misc/menu1.wav");
M_Menu_Options_f(cmd);
int bitsperpixel;
qbool fullscreen;
float refreshrate;
- qbool userefreshrate;
qbool stereobuffer;
int samples;
}
extern cvar_t vid_bitsperpixel;
extern cvar_t vid_samples;
extern cvar_t vid_refreshrate;
-extern cvar_t vid_userefreshrate;
extern cvar_t vid_touchscreen_density;
extern cvar_t vid_touchscreen_xdpi;
extern cvar_t vid_touchscreen_ydpi;
SDL_DisplayMode modewanted, modeclosest;
modewanted.w = vid_width.integer;
modewanted.h = vid_height.integer;
- modewanted.refresh_rate = vid_userefreshrate.integer ? vid_refreshrate.integer : 0;
+ modewanted.refresh_rate = max(0, vid_refreshrate.integer);
if (!SDL_GetClosestDisplayMode(vid.displayindex, &modewanted, &modeclosest))
{
Con_Printf(CON_ERROR "Error getting closest mode to %ix%i@%ihz for display %i: \"%s\"\n", modewanted.w, modewanted.h, modewanted.refresh_rate, vid.displayindex, SDL_GetError());
cvar_t vid_height = {CF_CLIENT | CF_ARCHIVE, "vid_height", "480", "resolution"};
cvar_t vid_bitsperpixel = {CF_CLIENT | CF_READONLY, "vid_bitsperpixel", "32", "how many bits per pixel to render at (this is not currently configurable)"};
cvar_t vid_samples = {CF_CLIENT | CF_ARCHIVE, "vid_samples", "1", "how many anti-aliasing samples per pixel to request from the graphics driver (4 is recommended, 1 is faster)"};
-cvar_t vid_refreshrate = {CF_CLIENT | CF_ARCHIVE, "vid_refreshrate", "60", "refresh rate to use, in hz (higher values flicker less, if supported by your monitor)"};
-cvar_t vid_userefreshrate = {CF_CLIENT | CF_ARCHIVE, "vid_userefreshrate", "0", "set this to 1 to make vid_refreshrate used, or to 0 to let the engine choose a sane default"};
+cvar_t vid_refreshrate = {CF_CLIENT | CF_ARCHIVE, "vid_refreshrate", "0", "refresh rate to use, in hz (higher values feel smoother, if supported by your monitor), 0 uses the default"};
cvar_t vid_stereobuffer = {CF_CLIENT | CF_ARCHIVE, "vid_stereobuffer", "0", "enables 'quad-buffered' stereo rendering for stereo shutterglasses, HMD (head mounted display) devices, or polarized stereo LCDs, if supported by your drivers"};
// the density cvars are completely optional, set and use when something needs to have a density-independent size.
// TODO: set them when changing resolution, setting them from the commandline will be independent from the resolution - use only if you have a native fixed resolution.
Cvar_RegisterVariable(&vid_bitsperpixel);
Cvar_RegisterVariable(&vid_samples);
Cvar_RegisterVariable(&vid_refreshrate);
- Cvar_RegisterVariable(&vid_userefreshrate);
Cvar_RegisterVariable(&vid_stereobuffer);
Cvar_RegisterVariable(&vid_touchscreen_density);
Cvar_RegisterVariable(&vid_touchscreen_xdpi);
mode->width = vid_width.integer;
mode->height = vid_height.integer;
mode->bitsperpixel = vid_bitsperpixel.integer;
- mode->refreshrate = vid_userefreshrate.integer ? max(1, vid_refreshrate.integer) : 0;
- mode->userefreshrate = vid_userefreshrate.integer != 0;
+ mode->refreshrate = max(0, vid_refreshrate.integer);
mode->stereobuffer = vid_stereobuffer.integer != 0;
}
cl_ignoremousemoves = 2;
oldmode = vid.mode;
Con_Printf("VID_Restart: changing from %s %dx%dx%dbpp%s, to %s %dx%dx%dbpp%s.\n",
- oldmode.fullscreen ? "fullscreen" : "window", oldmode.width, oldmode.height, oldmode.bitsperpixel, oldmode.fullscreen && oldmode.userefreshrate ? va(vabuf, sizeof(vabuf), "x%.2fhz", oldmode.refreshrate) : "",
- vid_fullscreen.integer ? "fullscreen" : "window", vid_width.integer, vid_height.integer, vid_bitsperpixel.integer, vid_fullscreen.integer && vid_userefreshrate.integer ? va(vabuf, sizeof(vabuf), "x%.2fhz", vid_refreshrate.value) : "");
+ oldmode.fullscreen ? "fullscreen" : "window", oldmode.width, oldmode.height, oldmode.bitsperpixel, oldmode.fullscreen && oldmode.refreshrate ? va(vabuf, sizeof(vabuf), "x%.2fhz", oldmode.refreshrate) : "",
+ vid_fullscreen.integer ? "fullscreen" : "window", vid_width.integer, vid_height.integer, vid_bitsperpixel.integer, vid_fullscreen.integer && vid_refreshrate.integer ? va(vabuf, sizeof(vabuf), "x%.2fhz", vid_refreshrate.value) : "");
SCR_DeferLoadingPlaque(false);
R_Modules_Shutdown();
VID_Shutdown();
{
{&vid_stereobuffer, "0"},
{&vid_samples, "1"},
- {&vid_userefreshrate, "0"},
+ {&vid_refreshrate, "0"},
{&vid_width, "640"},
{&vid_height, "480"},
{&vid_bitsperpixel, "32"},