From b9d8ceba0b06141a198982e2ee5b3cbc8ad6fa1d Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 6 Jul 2019 19:42:31 +0200 Subject: [PATCH] Reset vid_rate when using fallback display mode --- src/client/menu/videomenu.c | 1 + src/client/vid/glimp_sdl.c | 1 + src/client/vid/vid.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/menu/videomenu.c b/src/client/menu/videomenu.c index 46be5623..6bf16914 100644 --- a/src/client/menu/videomenu.c +++ b/src/client/menu/videomenu.c @@ -264,6 +264,7 @@ VID_MenuInit(void) 0 }; + // must be kept in sync with vid_modes[] in vid.c static const char *resolutions[] = { "[320 240 ]", "[400 300 ]", diff --git a/src/client/vid/glimp_sdl.c b/src/client/vid/glimp_sdl.c index fa7c6a6f..69c07ec8 100644 --- a/src/client/vid/glimp_sdl.c +++ b/src/client/vid/glimp_sdl.c @@ -531,6 +531,7 @@ GLimp_InitGraphics(int fullscreen, int *pwidth, int *pheight) /* Try to recover */ Cvar_SetValue("r_mode", 4); Cvar_SetValue("vid_fullscreen", 0); + Cvar_SetValue("vid_rate", -1); fullscreen = 0; *pwidth = width = 640; diff --git a/src/client/vid/vid.c b/src/client/vid/vid.c index e6e9ede1..06a6588b 100644 --- a/src/client/vid/vid.c +++ b/src/client/vid/vid.c @@ -206,7 +206,7 @@ typedef struct vidmode_s int mode; } vidmode_t; -// This must be the same as in videomenu.c! +// This must be the same as VID_MenuInit()->resolutions[] in videomenu.c! vidmode_t vid_modes[] = { {"Mode 0: 320x240", 320, 240, 0}, {"Mode 1: 400x300", 400, 300, 1},