Skip to content

Commit

Permalink
bring back old method
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Feb 21, 2024
1 parent 2b79c7d commit faa3c6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 11 additions & 6 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,11 +1149,13 @@ static void ResetResolution(int height, boolean reset_pitch)

video.unscaledw = (int)(unscaled_actualheight * aspect_ratio);

video.unscaledw &= ~1;
// Unscaled widescreen 16:9 resolution truncates to 426x240, which is not
// quite 16:9. To avoid visual instability, we calculate the scaled width
// without the actual aspect ratio. For example, at 1280x720 we get
// 1278x720.

video.width = (int)(actualheight * aspect_ratio);

video.width &= ~1;
double vertscale = (double)actualheight / (double)unscaled_actualheight;
video.width = (int)ceil(video.unscaledw * vertscale);

// [FG] For performance reasons, SDL2 insists that the screen pitch, i.e.
// the *number of bytes* that one horizontal row of pixels occupy in
Expand All @@ -1176,7 +1178,8 @@ static void ResetResolution(int height, boolean reset_pitch)
if (automapactive)
AM_ResetScreenSize();

I_Printf(VB_DEBUG, "ResetResolution: %dx%d", video.width, video.height);
I_Printf(VB_DEBUG, "ResetResolution: %dx%d (%dx%d)",
video.width, video.height, video.unscaledw, SCREENHEIGHT);

drs_skip_frame = true;
}
Expand Down Expand Up @@ -1703,7 +1706,7 @@ static struct {
{ 640, 480 },
{ 800, 600 },
{ 1024, 768 },
//{ 1280, 1024 },
{ 1280, 1024 },
{ 1280, 720 },
{ 1280, 800 },
{ 1366, 768 },
Expand All @@ -1717,6 +1720,7 @@ static struct {
{ 2304, 1440 },
{ 2560, 1600 },
{ 3200, 2400 },
{ 3440, 1440 },
{ 3840, 2160 },
{ 5120, 2160 }
};
Expand Down Expand Up @@ -1750,6 +1754,7 @@ void I_CheckHOM(void)
{
printf("HOM %dx%d\n",
native_res[curr_test_res - 1].w, native_res[curr_test_res - 1].h);
//run_test = false;
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,8 @@ void R_RenderPlayerView (player_t* player)
R_SetFuzzPosDraw();
R_DrawMasked ();

I_CheckHOM();
if (run_test)
I_CheckHOM();

// Check for new console commands.
NetUpdate ();
Expand Down

0 comments on commit faa3c6a

Please sign in to comment.