MCPcopy Create free account
hub / github.com/crownengine/crown / update

Method update

src/device/main_linux.cpp:419–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417 }
418
419 void update(fd_set *fdset)
420 {
421 for (u8 ii = 0; ii < CROWN_MAX_JOYPADS; ++ii) {
422 if (_fd[ii] == -1 || !FD_ISSET(_fd[ii], fdset))
423 continue;
424
425 // Read all events.
426 JoypadEvent events[64];
427 ssize_t num_bytes = read(_fd[ii], &events, sizeof(events));
428
429 if (num_bytes > 0) {
430 process_events(ii, events, num_bytes/ssize_t(sizeof(events[0])));
431 } else {
432 ::close(_fd[ii]);
433 _fd[ii] = -1;
434 _queue->push_status_event(InputDeviceType::JOYPAD, ii, false);
435 }
436 }
437 }
438};
439
440static bool s_exit = false;

Callers 1

runMethod · 0.45

Calls 1

readFunction · 0.50

Tested by

no test coverage detected