| 1284 | } |
| 1285 | |
| 1286 | float Node::runAction(Action* action, bool loop) { |
| 1287 | if (!action) return 0.0f; |
| 1288 | if (action->isRunning()) { |
| 1289 | stopAction(action); |
| 1290 | } |
| 1291 | action->_looped = loop; |
| 1292 | action->_target = this; |
| 1293 | action->_prev = nullptr; |
| 1294 | if (_action) { |
| 1295 | action->_next = _action; |
| 1296 | _action->_prev = action; |
| 1297 | _action = action; |
| 1298 | } else { |
| 1299 | action->_next = nullptr; |
| 1300 | _action = action; |
| 1301 | } |
| 1302 | _action->_elapsed = 0.0f; |
| 1303 | _action->resume(); |
| 1304 | if (isRunning()) { |
| 1305 | _scheduler->schedule(action); |
| 1306 | } |
| 1307 | return _action ? _action->getDuration() : 0.0f; |
| 1308 | } |
| 1309 | |
| 1310 | void Node::stopAllActions() { |
| 1311 | stopActionInList(_action); |
no test coverage detected