1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

tweak low res function checks

This commit is contained in:
FunkyFr3sh 2024-05-08 09:04:19 +02:00
parent 91cad99b6f
commit b8632698a4

View File

@ -685,12 +685,15 @@ BOOL util_detect_low_res_screen()
} }
else if (g_ddraw.isworms2) 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_width = w2_width;
g_ddraw.upscale_hack_height = (*pW2DS)->RenderHeight; g_ddraw.upscale_hack_height = w2_height;
InterlockedExchange(&g_ddraw.upscale_hack_active, FALSE); InterlockedExchange(&g_ddraw.upscale_hack_active, FALSE);
} }