mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Add a SetCursor() call to I_SetCursor() when the pointer is within the window's client area to
make the pointer change instant instead of waiting until the next mouse event. SVN r3010 (trunk)
This commit is contained in:
parent
54163bc81c
commit
f7fa3c8dbb
3 changed files with 20 additions and 2 deletions
|
@ -1049,7 +1049,7 @@ struct vissprite_t
|
|||
{
|
||||
short x1, x2;
|
||||
fixed_t cx; // for line side calculation
|
||||
fixed_t gx, gy; // for fake floor clipping
|
||||
fixed_t gx, gy; // for drawseg and fake floor clipping
|
||||
fixed_t gz, gzt; // global bottom / top for silhouette clipping
|
||||
fixed_t startfrac; // horizontal position of x1
|
||||
fixed_t xscale, yscale;
|
||||
|
|
|
@ -118,7 +118,6 @@ extern int BlockMouseMove;
|
|||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
static bool NativeMouse;
|
||||
static EMouseMode MouseMode = MM_None;
|
||||
static FMouse *(*MouseFactory[])() =
|
||||
{
|
||||
|
@ -130,6 +129,7 @@ static FMouse *(*MouseFactory[])() =
|
|||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
FMouse *Mouse;
|
||||
bool NativeMouse;
|
||||
|
||||
bool CursorState;
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ extern HANDLE StdOut;
|
|||
extern bool FancyStdOut;
|
||||
extern HINSTANCE g_hInst;
|
||||
extern FILE *Logfile;
|
||||
extern bool NativeMouse;
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
|
@ -1214,6 +1215,23 @@ bool I_SetCursor(FTexture *cursorpic)
|
|||
cursor = LoadCursor(NULL, IDC_ARROW);
|
||||
}
|
||||
SetClassLongPtr(Window, GCLP_HCURSOR, (LONG_PTR)cursor);
|
||||
if (NativeMouse)
|
||||
{
|
||||
POINT pt;
|
||||
RECT client;
|
||||
|
||||
// If the mouse pointer is within the window's client rect, set it now.
|
||||
if (GetCursorPos(&pt) && GetClientRect(Window, &client) &&
|
||||
ClientToScreen(Window, (LPPOINT)&client.left) &&
|
||||
ClientToScreen(Window, (LPPOINT)&client.right))
|
||||
{
|
||||
if (pt.x >= client.left && pt.x < client.right &&
|
||||
pt.y >= client.top && pt.y < client.bottom)
|
||||
{
|
||||
SetCursor(cursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue