MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / joyGetNumDevs

Function joyGetNumDevs

ddio/sdljoy.cpp:319–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319static int joyGetNumDevs(void) {
320 int found = 0;
321
322 // rcg06182000 add support for specific joydev.
323 int rc = FindArgChar("-joystick", 'j');
324 specificJoy = -1;
325 if ((rc > 0) && (GameArgs[rc + 1] != NULL)) {
326 specificJoy = atoi(GameArgs[rc + 1]);
327 if ((specificJoy >= 0) && (specificJoy < SDL_NumJoysticks())) {
328 found = 1;
329 } else {
330 specificJoy = -1;
331 }
332 }
333 if (specificJoy < 0) {
334 found = SDL_NumJoysticks();
335 }
336
337 mprintf(0, "Joystick: Found %d joysticks.", found);
338 return found;
339}
340
341void ddio_InternalJoyFrame(void) {
342 // All the work is done already in SDL_PumpEvents()

Callers 2

DetectSticksMethod · 0.85
joy_InitFunction · 0.85

Calls 1

FindArgCharFunction · 0.85

Tested by

no test coverage detected