mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-19 10:31:08 +00:00
tidied up whitespace in osx mouse acceleration hack code. fixed declaration
of the new cvar to use the new cvar flags. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@601 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
31ad97cccd
commit
5e9d475661
1 changed files with 39 additions and 51 deletions
|
@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "SDL.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Mouse acceleration needs to be disabled
|
||||
/* Mouse acceleration needs to be disabled on OS X */
|
||||
#define MACOS_X_ACCELERATION_HACK
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +54,7 @@ static int buttonremap[] =
|
|||
cvar_t m_filter = {"m_filter","0",CVAR_NONE};
|
||||
|
||||
#ifdef MACOS_X_ACCELERATION_HACK
|
||||
cvar_t in_disablemacosxmouseaccel = {"in_disablemacosxmouseaccel", "1", true};
|
||||
static cvar_t in_disablemacosxmouseaccel = {"in_disablemacosxmouseaccel", "1", CVAR_ARCHIVE};
|
||||
static double originalMouseSpeed = -1.0;
|
||||
#endif
|
||||
|
||||
|
@ -76,12 +76,7 @@ static int FilterMouseEvents (const SDL_Event *event)
|
|||
}
|
||||
|
||||
#ifdef MACOS_X_ACCELERATION_HACK
|
||||
/*
|
||||
===============
|
||||
IN_GetIOHandle
|
||||
===============
|
||||
*/
|
||||
static io_connect_t IN_GetIOHandle(void) // mac os x mouse accel hack
|
||||
static io_connect_t IN_GetIOHandle(void)
|
||||
{
|
||||
io_connect_t iohandle = MACH_PORT_NULL;
|
||||
kern_return_t status;
|
||||
|
@ -110,10 +105,7 @@ void IN_Activate (void)
|
|||
return;
|
||||
|
||||
#ifdef MACOS_X_ACCELERATION_HACK
|
||||
// mac os x mouse accel hack
|
||||
{
|
||||
// Save the status of mouse acceleration
|
||||
|
||||
/* Save the status of mouse acceleration */
|
||||
if (originalMouseSpeed == -1 && in_disablemacosxmouseaccel.value)
|
||||
{
|
||||
io_connect_t mouseDev = IN_GetIOHandle();
|
||||
|
@ -140,7 +132,6 @@ void IN_Activate (void)
|
|||
Cvar_Set ("in_disablemacosxmouseaccel", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_ON)
|
||||
|
@ -170,8 +161,6 @@ void IN_Deactivate (qboolean free_cursor)
|
|||
return;
|
||||
|
||||
#ifdef MACOS_X_ACCELERATION_HACK
|
||||
// mac os x mouse accel hack
|
||||
{
|
||||
if (originalMouseSpeed != -1.0)
|
||||
{
|
||||
io_connect_t mouseDev = IN_GetIOHandle();
|
||||
|
@ -187,7 +176,6 @@ void IN_Deactivate (qboolean free_cursor)
|
|||
}
|
||||
originalMouseSpeed = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (free_cursor)
|
||||
|
|
Loading…
Reference in a new issue