- Added m_hidepointer cvar to control whether or not the mouse pointer is hidden when it's

grabbed. At least if the pointer is visible when the debugger break happens, I don't worry
  about it getting stuck hidden. (Note that that seems to be related to Alt+Tabbing out of the
  game and coming back. I wish I knew what's going on.)

SVN r2497 (trunk)
This commit is contained in:
Randy Heit 2010-08-08 02:04:47 +00:00
parent 6000217889
commit 6234e7445b

View file

@ -139,6 +139,7 @@ bool CursorState;
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_hidepointer, true, 0)
CUSTOM_CVAR (Int, in_mouse, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) CUSTOM_CVAR (Int, in_mouse, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
{ {
@ -181,10 +182,10 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
static void SetCursorState(bool visible) static void SetCursorState(bool visible)
{ {
CursorState = visible; CursorState = visible || !m_hidepointer;
if (GetForegroundWindow() == Window) if (GetForegroundWindow() == Window)
{ {
if (visible) if (CursorState)
{ {
SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR)); SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR));
} }