Skip to content

Commit

Permalink
only use windowed hack if window is smaller than screen size
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Nov 3, 2024
1 parent 2c69e41 commit 4db1628
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,12 +1540,14 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
}
else if (!g_ddraw.width)
{
g_ddraw.windowed_hack = TRUE;

RECT rc = { 0 };
real_GetClientRect(hwnd, &rc);

dd_SetDisplayMode(rc.right, rc.bottom, 16, 0);
if (rc.right < real_GetSystemMetrics(SM_CXSCREEN) && rc.bottom < real_GetSystemMetrics(SM_CYSCREEN))
{
g_ddraw.windowed_hack = TRUE;
dd_SetDisplayMode(rc.right, rc.bottom, 16, 0);
}
}
}
else
Expand Down

0 comments on commit 4db1628

Please sign in to comment.