Skip to content

Commit

Permalink
allow zooming on low resolutions as well (worms2)
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed May 8, 2024
1 parent d97dd8e commit 38b5531
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
g_ddraw.iskkndx = strcmp(g_ddraw.title, "KKND Xtreme") == 0;
g_ddraw.isworms2 = strcmp(g_ddraw.title, "worms2") == 0;

if (g_ddraw.iskkndx || g_ddraw.isworms2)
if (g_ddraw.iskkndx)
{
g_ddraw.upscale_hack_width = 640;
g_ddraw.upscale_hack_height = 480;
Expand All @@ -1202,6 +1202,11 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
g_ddraw.upscale_hack_width = 640;
g_ddraw.upscale_hack_height = 400;
}
else if (g_ddraw.isworms2)
{
g_ddraw.upscale_hack_width = 80;
g_ddraw.upscale_hack_height = 60;
}

if (g_config.vhack && !g_ddraw.isredalert && !g_ddraw.iscnc1 && !g_ddraw.iskkndx && !g_ddraw.isworms2)
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ BOOL util_detect_low_res_screen()
}
else if (g_ddraw.isworms2)
{
if ((*pW2DS)->RenderWidth < g_ddraw.width && (*pW2DS)->RenderHeight < g_ddraw.height)
if ((*pW2DS)->RenderWidth && (*pW2DS)->RenderWidth < g_ddraw.width && (*pW2DS)->RenderHeight < g_ddraw.height)
{
if (g_ddraw.upscale_hack_width != (*pW2DS)->RenderWidth || g_ddraw.upscale_hack_height != (*pW2DS)->RenderHeight)
{
Expand Down

0 comments on commit 38b5531

Please sign in to comment.