remove "handlemouse" setting

This commit is contained in:
FunkyFr3sh 2021-06-16 05:57:19 +02:00
parent abdb74942b
commit 684224b833
10 changed files with 175 additions and 181 deletions

View file

@ -12,27 +12,23 @@ void mouse_lock()
return;
if (g_ddraw->devmode)
{
if (g_ddraw->handlemouse)
while (real_ShowCursor(FALSE) >= 0);
return;
}
if (g_hook_active && !g_ddraw->locked)
{
/* Get the window client area */
real_GetClientRect(g_ddraw->hwnd, &rc);
if (g_ddraw->adjmouse)
{
rc.right = g_ddraw->render.viewport.width;
rc.bottom = g_ddraw->render.viewport.height;
rc.top = g_ddraw->render.viewport.y;
rc.left = g_ddraw->render.viewport.x;
rc.right = g_ddraw->render.viewport.width + g_ddraw->render.viewport.x;
rc.bottom = g_ddraw->render.viewport.height + g_ddraw->render.viewport.y;
}
else
{
rc.right = g_ddraw->width;
rc.bottom = g_ddraw->height;
rc.top = g_ddraw->render.viewport.y;
rc.left = g_ddraw->render.viewport.x;
rc.right = g_ddraw->width + g_ddraw->render.viewport.x;
rc.bottom = g_ddraw->height + g_ddraw->render.viewport.y;
}
/* Convert the client area to screen coordinates */
@ -57,24 +53,16 @@ void mouse_lock()
real_SetCursorPos(rc.left + g_ddraw->cursor.x, rc.top + g_ddraw->cursor.y - g_ddraw->mouse_y_adjust);
}
if (g_ddraw->handlemouse)
{
real_ClipCursor(&rc);
while (real_ShowCursor(FALSE) >= 0);
}
else
{
real_SetCursor(g_ddraw->old_cursor);
real_SetCursor(g_ddraw->old_cursor);
if (g_ddraw->hidecursor)
{
g_ddraw->hidecursor = FALSE;
real_ShowCursor(FALSE);
}
real_ClipCursor(&rc);
if (g_ddraw->hidecursor)
{
g_ddraw->hidecursor = FALSE;
real_ShowCursor(FALSE);
}
real_ClipCursor(&rc);
g_ddraw->locked = TRUE;
}
}
@ -84,17 +72,10 @@ void mouse_unlock()
RECT rc;
if (g_ddraw->devmode)
{
if (g_ddraw->handlemouse)
while (real_ShowCursor(TRUE) < 0);
return;
}
if (!g_hook_active)
{
return;
}
if (g_ddraw->locked)
{
@ -112,19 +93,11 @@ void mouse_unlock()
SetRect(&rc, pt.x, pt.y, pt2.x, pt2.y);
if (g_ddraw->handlemouse)
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));
}
else
{
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));