MCPcopy Create free account
hub / github.com/OGRECave/ogre / applyTextureAliases

Function applyTextureAliases

OgreMain/src/OgreScriptTranslator.cpp:48–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47namespace 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);

Callers 1

translateMethod · 0.85

Calls 9

_fireEventMethod · 0.80
getNumFramesMethod · 0.80
getAnimationDurationMethod · 0.80
setTextureNameMethod · 0.80
getTextureTypeMethod · 0.80
findMethod · 0.45
getNameMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected