mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
make cursor visible on unlock for tiberian sun
This commit is contained in:
parent
294e103421
commit
ec435d21d3
@ -112,6 +112,7 @@ typedef struct IDirectDrawImpl
|
|||||||
LONG minimized;
|
LONG minimized;
|
||||||
DWORD ticklength;
|
DWORD ticklength;
|
||||||
BOOL altenter;
|
BOOL altenter;
|
||||||
|
BOOL hidecursor;
|
||||||
|
|
||||||
} IDirectDrawImpl;
|
} IDirectDrawImpl;
|
||||||
|
|
||||||
|
16
src/mouse.c
16
src/mouse.c
@ -257,7 +257,14 @@ void mouse_lock()
|
|||||||
while (ShowCursor(FALSE) > 0);
|
while (ShowCursor(FALSE) > 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (ddraw->hidecursor)
|
||||||
|
{
|
||||||
|
ddraw->hidecursor = FALSE;
|
||||||
|
ShowCursor(FALSE);
|
||||||
|
}
|
||||||
ClipCursor(&rc);
|
ClipCursor(&rc);
|
||||||
|
}
|
||||||
|
|
||||||
ddraw->locked = TRUE;
|
ddraw->locked = TRUE;
|
||||||
}
|
}
|
||||||
@ -299,6 +306,15 @@ void mouse_unlock()
|
|||||||
while (ShowCursor(TRUE) < 0);
|
while (ShowCursor(TRUE) < 0);
|
||||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CURSORINFO ci = { .cbSize = sizeof(CURSORINFO) };
|
||||||
|
if (GetCursorInfo(&ci) && ci.flags == 0)
|
||||||
|
{
|
||||||
|
ddraw->hidecursor = TRUE;
|
||||||
|
ShowCursor(TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClipCursor(NULL);
|
ClipCursor(NULL);
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user