Skip to content

Commit

Permalink
Fix web client vid_restart with r_mode -2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed Jun 25, 2024
1 parent c1ab47a commit 99be115
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/sdl/sdl_glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 99be115

Please sign in to comment.