Revert "remove "handlemouse" setting"

This reverts commit f1bcff220d.
This commit is contained in:
FunkyFr3sh 2021-06-16 07:47:15 +02:00
parent 6043bc9061
commit abdb74942b
10 changed files with 181 additions and 175 deletions

View file

@ -513,6 +513,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setBy
g_ddraw->render.mode.dmBitsPerPel = g_ddraw->render.bpp;
}
BOOL maintas = g_ddraw->maintas;
if (!g_ddraw->windowed)
{
/* Making sure the chosen resolution is valid */
@ -562,6 +564,9 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setBy
old_height,
g_ddraw->mode.dmPelsWidth,
g_ddraw->mode.dmPelsHeight);
if (found_res)
maintas = TRUE;
}
g_ddraw->render.width = res.cx;
@ -590,6 +595,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setBy
g_ddraw->windowed = TRUE;
}
else
maintas = TRUE;
}
}
}
@ -601,6 +608,11 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setBy
g_ddraw->render.height++;
}
if (!g_ddraw->handlemouse)
{
g_ddraw->boxing = maintas = FALSE;
}
g_ddraw->render.viewport.width = g_ddraw->render.width;
g_ddraw->render.viewport.height = g_ddraw->render.height;
g_ddraw->render.viewport.x = 0;
@ -624,7 +636,7 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setBy
g_ddraw->render.viewport.y = g_ddraw->render.height / 2 - g_ddraw->render.viewport.height / 2;
g_ddraw->render.viewport.x = g_ddraw->render.width / 2 - g_ddraw->render.viewport.width / 2;
}
else if (g_ddraw->maintas)
else if (maintas)
{
g_ddraw->render.viewport.width = g_ddraw->render.width;
g_ddraw->render.viewport.height =
@ -819,19 +831,14 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
SetPixelFormat(g_ddraw->render.hdc, ChoosePixelFormat(g_ddraw->render.hdc, &pfd), &pfd);
}
/* Make sure the cursor is visible in windowed mode initially */
if (g_ddraw->windowed)
if (g_ddraw->handlemouse && g_ddraw->windowed)
{
CURSORINFO ci = { .cbSize = sizeof(CURSORINFO) };
if (real_GetCursorInfo(&ci) && ci.flags == 0)
{
g_ddraw->hidecursor = TRUE;
while (real_ShowCursor(TRUE) < 0);
}
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
while (real_ShowCursor(FALSE) > 0); /* workaround for direct input games */
while (real_ShowCursor(TRUE) < 0);
}
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
GetWindowText(g_ddraw->hwnd, (LPTSTR)&g_ddraw->title, sizeof(g_ddraw->title));
g_ddraw->isredalert = strcmp(g_ddraw->title, "Red Alert") == 0;