-----------------------------------------------------------------------
| 418 | |
| 419 | //----------------------------------------------------------------------- |
| 420 | unsigned short Pass::getTextureUnitStateIndex(const TextureUnitState* state) const |
| 421 | { |
| 422 | OGRE_LOCK_MUTEX(mTexUnitChangeMutex); |
| 423 | assert(state && "state is 0 in Pass::getTextureUnitStateIndex()"); |
| 424 | |
| 425 | // only find index for state attached to this pass |
| 426 | OgreAssert(state->getParent() == this, "TextureUnitState is not attached to this pass"); |
| 427 | auto i = std::find(mTextureUnitStates.begin(), mTextureUnitStates.end(), state); |
| 428 | assert(i != mTextureUnitStates.end() && "state is supposed to attached to this pass"); |
| 429 | return static_cast<unsigned short>(std::distance(mTextureUnitStates.begin(), i)); |
| 430 | } |
| 431 | |
| 432 | //----------------------------------------------------------------------- |
| 433 | Pass::TextureUnitStateIterator |
no test coverage detected