Fix web client vid_restart with r_mode -2

If getting the display index of the existing window fails, fallback to
the default display size instead of falling back to 640x480.

emscripten r_mode -2 worked on window creation but vid_restart fellback
to 640x480.
This commit is contained in:
Zack Middleton committed 2024-06-24 22:38:48 -04:00
1 parent c1ab47a764
commit 99be1151f7
1 file changed
+2 -1
+2 -1
View File
@@ -438,10 +438,11 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder, qbool
if( display < 0 )
{
ri.Printf( PRINT_DEVELOPER, "SDL_GetWindowDisplayIndex() failed: %s\n", SDL_GetError() );
display = 0;
}
}
if( display >= 0 && SDL_GetDesktopDisplayMode( display, &desktopMode ) == 0 )
if( SDL_GetDesktopDisplayMode( display, &desktopMode ) == 0 )
{
displayAspect = (float)desktopMode.w / (float)desktopMode.h;