| 558 | } |
| 559 | |
| 560 | bool Action::updateProgress() { |
| 561 | if (!_action) return true; |
| 562 | if (_elapsed == 0.0f) { |
| 563 | float start = _reversed ? _action->getDuration() : 0.0f; |
| 564 | /* reset actions to initial state */ |
| 565 | Emit::available = false; // disable event callbacks while reseting |
| 566 | _action->update(_target, start); |
| 567 | Emit::available = true; |
| 568 | /* execute action right here */ |
| 569 | if (0.0f == _action->getDuration()) { |
| 570 | _action->update(_target, start); |
| 571 | return true; |
| 572 | } |
| 573 | return false; |
| 574 | } else if (_elapsed >= _action->getDuration()) { |
| 575 | float stop = _reversed ? 0.0f : _elapsed; |
| 576 | _action->update(_target, stop); |
| 577 | return true; |
| 578 | } else { |
| 579 | float current = _reversed ? _action->getDuration() - _elapsed : _elapsed; |
| 580 | _action->update(_target, current); |
| 581 | return false; |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | NS_DORA_END |
no test coverage detected