| 2169 | } |
| 2170 | |
| 2171 | bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) |
| 2172 | { |
| 2173 | Thread& st = mScriptThread[slot]; |
| 2174 | if (st.thread && st.sequence == seq && st.state == Thread::Play) |
| 2175 | return true; |
| 2176 | |
| 2177 | // Handle a -1 sequence, as this may be set when a thread has been destroyed. |
| 2178 | if(seq == -1) |
| 2179 | return true; |
| 2180 | |
| 2181 | if (seq < MaxSequenceIndex) { |
| 2182 | setMaskBits(ThreadMaskN << slot); |
| 2183 | st.sequence = seq; |
| 2184 | if (reset) { |
| 2185 | st.state = Thread::Play; |
| 2186 | st.atEnd = false; |
| 2187 | st.timescale = 1.f; |
| 2188 | st.position = 0.f; |
| 2189 | } |
| 2190 | if (mShapeInstance) { |
| 2191 | if (!st.thread) |
| 2192 | st.thread = mShapeInstance->addThread(); |
| 2193 | mShapeInstance->setSequence(st.thread,seq,st.position); |
| 2194 | updateThread(st); |
| 2195 | } |
| 2196 | return true; |
| 2197 | } |
| 2198 | return false; |
| 2199 | } |
| 2200 | |
| 2201 | void ShapeBase::updateThread(Thread& st) |
| 2202 | { |
no test coverage detected