remove window_event flag, skip DRS if frametime is too long

This commit is contained in:
Roman Fomin 2023-12-19 15:57:10 +07:00
parent ff86d91bc2
commit 3584cb67bb

View File

@ -106,8 +106,6 @@ boolean screenvisible = true;
boolean window_focused = true;
static boolean window_event = true;
void *I_GetSDLWindow(void)
{
return screen;
@ -402,7 +400,6 @@ static void I_GetEvent(void)
break;
case SDL_WINDOWEVENT:
window_event = true;
if (sdlevent.window.windowID == SDL_GetWindowID(screen))
{
HandleWindowEvent(&sdlevent.window);
@ -484,17 +481,12 @@ static void ResetLogicalSize(void);
static void DynamicResolution(void)
{
if (resolution_mode != RES_DRS || frametime_withoutpresent == 0)
if (resolution_mode != RES_DRS || frametime_withoutpresent == 0 ||
frametime_withoutpresent > 1000000 / 15)
{
return;
}
if (window_event)
{
window_event = false;
return;
}
// 1.25 milliseconds for SDL render present
double target = (1.0 / targetrefresh) - 0.00125;
double actual = frametime_withoutpresent / 1000000.0;