MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / load

Method load

src/Core/Animation/Animator.cpp:119–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 }
118
119 void Animator::load(System::Path path, Engine::ResourceManager* resources)
120 {
121 m_path = std::move(path);
122 Debug::Log->debug("<Animator> Loading Animator at {0}", m_path.toString());
123 std::vector<std::string> listDir;
124 m_path.loadAll(System::Loaders::dirPathLoader, listDir);
125 std::vector<std::string> allFiles;
126 m_path.loadAll(System::Loaders::filePathLoader, allFiles);
127 vili::node animatorCfgFile;
128 std::unordered_map<std::string, vili::node> animationParameters;
129 if (Utils::Vector::contains("animator.cfg.vili"s, allFiles))
130 {
131 animatorCfgFile
132 = vili::parser::from_file(m_path.add("animator.cfg.vili").find());
133 }
134 for (const auto& directory : listDir)
135 {
136 std::unique_ptr<Animation> tempAnim = std::make_unique<Animation>();
137 if (m_target)
138 {
139 tempAnim->setAntiAliasing(m_target->getAntiAliasing());
140 }
141 tempAnim->loadAnimation(m_path.add(directory), resources);
142 /*if (animationParameters.find(directory) != animationParameters.end()
143 && animationParameters.find("all") != animationParameters.end())
144 {
145 // tempAnim->applyParameters(*animationParameters["all"]);
146 // tempAnim->applyParameters(*animationParameters[directory]);
147 }
148 else if (animationParameters.find(directory) != animationParameters.end())
149 //tempAnim->applyParameters(*animationParameters[directory]);
150 else if (animationParameters.find("all") != animationParameters.end())
151 // tempAnim->applyParameters(*animationParameters["all"]);*/
152 m_animations[tempAnim->getName()] = move(tempAnim);
153 }
154 }
155
156 void Animator::update()
157 {

Callers

nothing calls this directly

Calls 11

from_fileFunction · 0.85
debugMethod · 0.80
loadAllMethod · 0.80
loadAnimationMethod · 0.80
containsFunction · 0.50
toStringMethod · 0.45
findMethod · 0.45
addMethod · 0.45
setAntiAliasingMethod · 0.45
getAntiAliasingMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected