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

Function getProgram

OgreMain/src/OgreScriptTranslator.cpp:2215–2237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2213 }
2214
2215 static GpuProgramPtr getProgram(ScriptCompiler* compiler, ObjectAbstractNode* node)
2216 {
2217 if(node->name.empty())
2218 {
2219 compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, node->file, node->line);
2220 return nullptr;
2221 }
2222
2223 ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, node->name);
2224 compiler->_fireEvent(&evt, 0);
2225
2226 auto& mgr = GpuProgramManager::getSingleton();
2227 if (auto ret = mgr.getByName(evt.mName, compiler->getResourceGroup()))
2228 return ret;
2229
2230 // recheck with auto resource group
2231 if (auto ret = mgr.getByName(evt.mName, RGN_AUTODETECT))
2232 return ret;
2233
2234 compiler->addError(ScriptCompiler::CE_REFERENCETOANONEXISTINGOBJECT, node->file, node->line,
2235 evt.mName);
2236 return nullptr;
2237 }
2238
2239 //-------------------------------------------------------------------------
2240 void PassTranslator::translateProgramRef(GpuProgramType type, ScriptCompiler *compiler, ObjectAbstractNode *node)

Calls 5

addErrorMethod · 0.80
_fireEventMethod · 0.80
getResourceGroupMethod · 0.80
emptyMethod · 0.45
getByNameMethod · 0.45

Tested by

no test coverage detected