joystick system initialization
| 99 | |
| 100 | // joystick system initialization |
| 101 | bool joy_Init(bool remote) { |
| 102 | // reinitialize joystick if already initialized. |
| 103 | joy_Close(); |
| 104 | if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) { |
| 105 | // FIXME: report an error? |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | // check if this OS supports joysticks |
| 110 | if (!joyGetNumDevs() && !remote) { |
| 111 | return false; |
| 112 | } |
| 113 | |
| 114 | // rcg06182000 specific joystick support. |
| 115 | if (specificJoy >= 0) { |
| 116 | joy_InitStick((tJoystick)specificJoy, NULL); |
| 117 | } // if |
| 118 | else { |
| 119 | // initialize joystick list |
| 120 | for (int i = 0; i < MAX_JOYSTICKS; i++) { |
| 121 | joy_InitStick((tJoystick)i, NULL); |
| 122 | } |
| 123 | } // else |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | void joy_Close() { |
| 128 | // initialize joystick list |
no test coverage detected