------------------------------------------------------------------------------
| 390 | |
| 391 | //------------------------------------------------------------------------------ |
| 392 | bool DInputManager::enableXInput() |
| 393 | { |
| 394 | // Largely, this series of functions is identical to the Joystick versions, |
| 395 | // except that XInput cannot be "activated" or "deactivated". You either have |
| 396 | // the DLL or you don't. Beyond that, you have up to four controllers |
| 397 | // connected at any given time |
| 398 | |
| 399 | DInputManager* mgr = dynamic_cast<DInputManager*>( Input::getManager() ); |
| 400 | if ( !mgr || !mgr->isEnabled() ) |
| 401 | return( false ); |
| 402 | |
| 403 | if ( mgr->isXInputActive() ) |
| 404 | return( true ); |
| 405 | |
| 406 | if ( Input::isActive() ) |
| 407 | mgr->activateXInput(); |
| 408 | |
| 409 | if ( smXInputEnabled ) |
| 410 | { |
| 411 | Con::printf( "XInput enabled." ); |
| 412 | #ifdef LOG_INPUT |
| 413 | Input::log( "XInput enabled.\n" ); |
| 414 | #endif |
| 415 | } |
| 416 | else |
| 417 | { |
| 418 | Con::warnf( "XInput failed to enable!" ); |
| 419 | #ifdef LOG_INPUT |
| 420 | Input::log( "XInput failed to enable!\n" ); |
| 421 | #endif |
| 422 | } |
| 423 | |
| 424 | return( smXInputEnabled ); |
| 425 | } |
| 426 | |
| 427 | //------------------------------------------------------------------------------ |
| 428 | void DInputManager::disableXInput() |
nothing calls this directly
no test coverage detected