MCPcopy Create free account
hub / github.com/dfranx/SHADERed / LoadModel

Method LoadModel

src/SHADERed/Objects/ProjectParser.cpp:992–1010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

990 return string;
991 }
992 eng::Model* ProjectParser::LoadModel(const std::string& file)
993 {
994 // return already loaded model
995 for (auto& mdl : m_models)
996 if (mdl.first == file)
997 return mdl.second;
998
999 m_models.push_back(std::make_pair(file, new eng::Model()));
1000
1001 // load the model
1002 std::string path = GetProjectPath(file);
1003 bool loaded = m_models[m_models.size() - 1].second->LoadFromFile(path);
1004 if (!loaded) {
1005 m_models.erase(m_models.begin() + (m_models.size() - 1));
1006 return nullptr;
1007 }
1008
1009 return m_models[m_models.size() - 1].second;
1010 }
1011 void ProjectParser::SaveProjectFile(const std::string& file, const std::string& data)
1012 {
1013 std::ofstream out(GetProjectPath(file));

Callers 5

UpdateMethod · 0.80
CreateMethod · 0.80
DuplicateMethod · 0.80
m_addShaderPassMethod · 0.80
m_addPluginItemMethod · 0.80

Calls 5

push_backMethod · 0.45
LoadFromFileMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected