mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Fix game shutting down on error
This commit is contained in:
parent
5b327c0417
commit
841076f2a9
1 changed files with 7 additions and 1 deletions
|
@ -54,6 +54,12 @@ static int num_displays = 0;
|
|||
static void
|
||||
ClampDisplayIndexCvar(void)
|
||||
{
|
||||
if (!vid_displayindex)
|
||||
{
|
||||
// uninitialized render?
|
||||
return;
|
||||
}
|
||||
|
||||
if (vid_displayindex->value < 0 || vid_displayindex->value >= num_displays)
|
||||
{
|
||||
Cvar_SetValue("vid_displayindex", 0);
|
||||
|
@ -179,7 +185,7 @@ CreateSDLWindow(int flags, int w, int h)
|
|||
}
|
||||
else
|
||||
{
|
||||
Com_Printf("User requested %ix%i@%i, setting closest mode %ix%i@%i\n",
|
||||
Com_Printf("User requested %ix%i@%i, setting closest mode %ix%i@%i\n",
|
||||
w, h, requested_mode.refresh_rate, w, h, closest_mode.refresh_rate);
|
||||
|
||||
if (SDL_SetWindowDisplayMode(window, &closest_mode) != 0)
|
||||
|
|
Loading…
Reference in a new issue