Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
fix aspect ration for the canonical screen resolutions (#162)
Browse files Browse the repository at this point in the history
Make sure to leave "Aspect Ratio" set to "Auto" and "Status Bar and Menu Appearance" to "Not Adjusted" for both 320x200 and 640x400.

Fixes #94 and hopefully fixes #147.
  • Loading branch information
fabiangreffrath committed Jan 7, 2021
1 parent 64a1f72 commit 27038bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions prboom2/src/SDL/i_video.c
Expand Up @@ -1247,7 +1247,11 @@ void I_UpdateVideoMode(void)
init_flags);
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, flags);

SDL_RenderSetLogicalSize(sdl_renderer, REAL_SCREENWIDTH, REAL_SCREENHEIGHT);
if ((SCREENWIDTH == 320 && SCREENHEIGHT == 200) ||
(SCREENWIDTH == 640 && SCREENHEIGHT == 400))
SDL_RenderSetLogicalSize(sdl_renderer, REAL_SCREENWIDTH, 6*REAL_SCREENHEIGHT/5);
else
SDL_RenderSetLogicalSize(sdl_renderer, REAL_SCREENWIDTH, REAL_SCREENHEIGHT);

screen = SDL_CreateRGBSurface(0, SCREENWIDTH, SCREENHEIGHT, V_GetNumPixelBits(), 0, 0, 0, 0);
buffer = SDL_CreateRGBSurface(0, REAL_SCREENWIDTH, REAL_SCREENHEIGHT, 32, 0, 0, 0, 0);
Expand Down Expand Up @@ -1520,7 +1524,4 @@ void UpdateGrab(void)

static void ApplyWindowResize(SDL_Event *resize_event)
{
int w = resize_event->window.data1;
int h = resize_event->window.data2;
SDL_RenderSetLogicalSize(sdl_renderer, w, w * REAL_SCREENHEIGHT / REAL_SCREENWIDTH);
}

0 comments on commit 27038bb

Please sign in to comment.