------------------------------------------------------------------------------
| 297 | |
| 298 | //------------------------------------------------------------------------------ |
| 299 | bool DInputManager::enableJoystick() |
| 300 | { |
| 301 | DInputManager* mgr = dynamic_cast<DInputManager*>( Input::getManager() ); |
| 302 | if ( !mgr || !mgr->isEnabled() ) |
| 303 | return( false ); |
| 304 | |
| 305 | if ( smJoystickEnabled && mgr->isJoystickActive() ) |
| 306 | return( true ); |
| 307 | |
| 308 | smJoystickEnabled = true; |
| 309 | if ( Input::isActive() ) |
| 310 | smJoystickEnabled = mgr->activateJoystick(); |
| 311 | |
| 312 | if ( smJoystickEnabled ) |
| 313 | { |
| 314 | Con::printf( "DirectInput joystick enabled." ); |
| 315 | #ifdef LOG_INPUT |
| 316 | Input::log( "Joystick enabled.\n" ); |
| 317 | #endif |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | Con::warnf( "DirectInput joystick failed to enable!" ); |
| 322 | #ifdef LOG_INPUT |
| 323 | Input::log( "Joystick failed to enable!\n" ); |
| 324 | #endif |
| 325 | } |
| 326 | |
| 327 | return( smJoystickEnabled ); |
| 328 | } |
| 329 | |
| 330 | //------------------------------------------------------------------------------ |
| 331 | void DInputManager::disableJoystick() |
nothing calls this directly
no test coverage detected