| 46 | |
| 47 | namespace Ogre{ |
| 48 | static void applyTextureAliases(ScriptCompiler *compiler, const Material* mat, const NameValuePairList& aliasList) |
| 49 | { |
| 50 | for (auto t : mat->getTechniques()) |
| 51 | { |
| 52 | for (auto p : t->getPasses()) |
| 53 | { |
| 54 | for (auto tus : p->getTextureUnitStates()) |
| 55 | { |
| 56 | auto aliasIt = aliasList.find(tus->getName()); |
| 57 | if (aliasIt == aliasList.end()) |
| 58 | continue; |
| 59 | |
| 60 | ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::TEXTURE, aliasIt->second); |
| 61 | compiler->_fireEvent(&evt, 0); |
| 62 | |
| 63 | if (tus->getNumFrames() > 1) |
| 64 | tus->setAnimatedTextureName(evt.mName, tus->getNumFrames(), |
| 65 | tus->getAnimationDuration()); |
| 66 | else |
| 67 | tus->setTextureName(evt.mName, tus->getTextureType()); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | template <typename T> |
| 74 | bool getValue(const AbstractNodePtr &node, T& result); |
no test coverage detected