MCPcopy Create free account
hub / github.com/clementgallet/libTAS / handleEvent

Method handleEvent

src/program/GameEvents.cpp:363–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363int GameEvents::handleEvent()
364{
365 /* Implement frame-advance auto-repeat */
366 bool ar_advance = false;
367 if (ar_ticks >= 0) {
368 ar_ticks++;
369 if ((ar_ticks > ar_delay) && !(ar_ticks % ar_freq))
370 /* Trigger auto-repeat */
371 ar_advance = true;
372 }
373
374 struct HotKey hk;
375 EventType eventType = EVENT_TYPE_NONE;
376 int flags = ar_advance?RETURN_FLAG_ADVANCE:0;
377
378 do {
379 eventType = nextEvent(hk);
380
381 if (eventType != EVENT_TYPE_NONE) {
382 flags |= RETURN_FLAG_EVENT;
383 flags |= RETURN_FLAG_UPDATE; // For now, mark all events for update
384 if (processEvent(eventType, hk))
385 flags |= RETURN_FLAG_ADVANCE;
386 }
387 else {
388 movie->inputs->processPendingActions();
389 }
390 } while (eventType != EVENT_TYPE_NONE && !(flags & RETURN_FLAG_ADVANCE));
391
392 return flags;
393}

Callers 1

startMethod · 0.80

Calls 1

processPendingActionsMethod · 0.80

Tested by

no test coverage detected