use real GetCursorPos
This commit is contained in:
parent
1bbb2e62b7
commit
a85a7533e3
3 changed files with 17 additions and 7 deletions
|
@ -602,12 +602,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ddraw->cursor.x = GET_X_LPARAM(lParam);
|
||||
ddraw->cursor.y = GET_Y_LPARAM(lParam);
|
||||
|
||||
if (ddraw->devmode)
|
||||
{
|
||||
mouse_lock();
|
||||
ddraw->cursor.x = GET_X_LPARAM(lParam);
|
||||
ddraw->cursor.y = GET_Y_LPARAM(lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
11
src/mouse.c
11
src/mouse.c
|
@ -37,6 +37,17 @@ BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
|||
{
|
||||
if (lpPoint)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
if (!GetCursorPos(&pt))
|
||||
return FALSE;
|
||||
|
||||
if(ddraw->locked && (!ddraw->windowed || ScreenToClient(ddraw->hWnd, &pt)))
|
||||
{
|
||||
ddraw->cursor.x = pt.x;
|
||||
ddraw->cursor.y = pt.y;
|
||||
}
|
||||
|
||||
lpPoint->x = (int)ddraw->cursor.x;
|
||||
lpPoint->y = (int)ddraw->cursor.y;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue