/* * IN_StartupMouse */ static void IN_StartupMouse( void ) { cvar_t *cv; cv = Cvar_Get( "in_initmouse", "1", CVAR_NOSET ); if( !cv->integer ) { return; } dinput_initialized = false; rawinput_initialized = false; cv = Cvar_Get( "m_raw", "1", CVAR_ARCHIVE ); if( cv->integer ) { rawinput_initialized = IN_RawInput_Init(); } if( !rawinput_initialized ) { cv = Cvar_Get( "in_dinput", "0", CVAR_ARCHIVE ); if( cv->integer ) { dinput_initialized = IN_InitDInput(); } } if( rawinput_initialized ) { Com_Printf( "Raw input initialized with %i mice\n", rawmicecount ); } else if( dinput_initialized ) { Com_Printf( "DirectInput initialized\n" ); } else { Com_Printf( "DirectInput not initialized, using standard input\n" ); } mouseinitialized = true; mouseparmsvalid = SystemParametersInfo( SPI_GETMOUSE, 0, originalmouseparms, 0 ); mouse_buttons = 8; mouse_wheel_type = MWHEEL_UNKNOWN; }
void IN_StartupMouse (void) { if (in_mouse.integer == mt_none) return; mouseinitialized = true; in_mwheeltype = MWHEEL_UNKNOWN; #if DIRECTINPUT_VERSION >= 0x0700 if (in_mouse.integer == mt_dinput) { dinput = IN_InitDInput(); if (dinput) { Com_Printf_State (PRINT_OK, "DirectInput initialized\n"); mouse_buttons = 8; if (use_m_smooth) Com_Printf_State (PRINT_OK, "Mouse smoothing initialized\n"); } else { Com_Printf_State (PRINT_FAIL, "DirectInput not initialized\n"); } } #endif // DIRECTINPUT_VERSION >= 0x0700 if (!dinput) { mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0); if (mouseparmsvalid) { if (in_m_os_parameters.integer == 1) { // Keeps the OS acceleration settings. newmouseparms[2] = originalmouseparms[2]; } if (in_m_os_parameters.integer == 2) { // Keeps the OS speed settings. newmouseparms[0] = originalmouseparms[0]; newmouseparms[1] = originalmouseparms[1]; } if (in_m_os_parameters.integer > 2) { // Keeps both OS acceleration and speed settings. newmouseparms[0] = originalmouseparms[0]; newmouseparms[1] = originalmouseparms[1]; newmouseparms[2] = originalmouseparms[2]; } } mouse_buttons = 8; #ifdef USINGRAWINPUT if (in_mouse.integer == mt_raw) { IN_RawInput_Init(); } #endif // USINGRAWINPUT } // If a fullscreen video mode was set before the mouse was initialized, set the mouse state appropriately. if (mouseactivatetoggle) IN_ActivateMouse (); }