| 2320 | } |
| 2321 | |
| 2322 | bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) |
| 2323 | { |
| 2324 | Thread& st = mScriptThread[slot]; |
| 2325 | if (st.thread && st.sequence == seq && st.state == Thread::Play) |
| 2326 | return true; |
| 2327 | |
| 2328 | // Handle a -1 sequence, as this may be set when a thread has been destroyed. |
| 2329 | if(seq == -1) |
| 2330 | return true; |
| 2331 | |
| 2332 | if (seq < MaxSequenceIndex) { |
| 2333 | setMaskBits(ThreadMaskN << slot); |
| 2334 | st.sequence = seq; |
| 2335 | if (reset) { |
| 2336 | st.state = Thread::Play; |
| 2337 | st.atEnd = false; |
| 2338 | st.timescale = 1.f; |
| 2339 | st.position = 0.f; |
| 2340 | } |
| 2341 | if (mShapeInstance) { |
| 2342 | if (!st.thread) |
| 2343 | st.thread = mShapeInstance->addThread(); |
| 2344 | mShapeInstance->setSequence(st.thread,seq,st.position); |
| 2345 | updateThread(st); |
| 2346 | } |
| 2347 | return true; |
| 2348 | } |
| 2349 | return false; |
| 2350 | } |
| 2351 | |
| 2352 | void ShapeBase::updateThread(Thread& st) |
| 2353 | { |
no test coverage detected