Skip to content

Commit

Permalink
tweak low res function checks
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed May 8, 2024
1 parent 91cad99 commit b863269
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,15 @@ BOOL util_detect_low_res_screen()
}
else if (g_ddraw.isworms2)
{
if (*pW2DS && (*pW2DS)->RenderWidth && (*pW2DS)->RenderWidth < g_ddraw.width && (*pW2DS)->RenderHeight < g_ddraw.height)
DWORD w2_width = *pW2DS ? (*pW2DS)->RenderWidth : 0;
DWORD w2_height = *pW2DS ? (*pW2DS)->RenderHeight : 0;

if (w2_width && w2_width < g_ddraw.width && w2_height && w2_height < g_ddraw.height)
{
if (g_ddraw.upscale_hack_width != (*pW2DS)->RenderWidth || g_ddraw.upscale_hack_height != (*pW2DS)->RenderHeight)
if (g_ddraw.upscale_hack_width != w2_width || g_ddraw.upscale_hack_height != w2_height)
{
g_ddraw.upscale_hack_width = (*pW2DS)->RenderWidth;
g_ddraw.upscale_hack_height = (*pW2DS)->RenderHeight;
g_ddraw.upscale_hack_width = w2_width;
g_ddraw.upscale_hack_height = w2_height;
InterlockedExchange(&g_ddraw.upscale_hack_active, FALSE);
}

Expand Down

0 comments on commit b863269

Please sign in to comment.