Returns true once per trigger, when either frame or elapsed time matches.
| 452 | |
| 453 | // Returns true once per trigger, when either frame or elapsed time matches. |
| 454 | static bool TriggerReady(TimedTrigger& t, int frame, uint32_t elapsedMs) |
| 455 | { |
| 456 | if (t.fired) |
| 457 | return false; |
| 458 | if (t.frame >= 0 && frame == t.frame) |
| 459 | { |
| 460 | t.fired = true; |
| 461 | return true; |
| 462 | } |
| 463 | if (t.timeMs >= 0 && static_cast<int>(elapsedMs) >= t.timeMs) |
| 464 | { |
| 465 | t.fired = true; |
| 466 | return true; |
| 467 | } |
| 468 | return false; |
| 469 | } |
| 470 | |
| 471 | struct AutoKeyEvent |
| 472 | { |