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

Method loadAnimation

src/Core/Animation/Animation.cpp:96–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 void Animation::loadAnimation(
97 const System::Path& path, Engine::ResourceManager* resources)
98 {
99 Debug::Log->debug("<Animation> Loading Animation at {0}", path.toString());
100 const std::string animationConfigFile
101 = path.add(path.last() + ".ani.vili").find();
102 vili::node animationConfig = vili::parser::from_file(
103 animationConfigFile, Config::Templates::getAnimationTemplates());
104
105 try
106 {
107 // Meta
108 this->loadMeta(animationConfig.at("Meta"));
109 Debug::Log->trace(" <Animation> Loading Meta block");
110
111 // Images
112 this->loadImages(animationConfig.at("Images"), path, resources);
113 Debug::Log->trace(" <Animation> Loading Images block");
114
115 // Groups
116 Debug::Log->trace(" <Animation> Loading Groups block");
117 this->loadGroups(animationConfig.at("Groups"));
118
119 // Animation Code
120 Debug::Log->trace(" <Animation> Loading Animation block");
121 this->loadCode(animationConfig.at("Animation"));
122 }
123 catch (const vili::exceptions::unknown_child_node& e)
124 {
125 const auto rootCause
126 = Exceptions::MissingAnimationProperty(e.key, EXC_INFO).nest(e);
127 throw Exceptions::InvalidAnimationFile(animationConfigFile, EXC_INFO)
128 .nest(rootCause);
129 }
130 catch (const Exception& e)
131 {
132 throw Exceptions::InvalidAnimationFile(animationConfigFile, EXC_INFO).nest(e);
133 }
134 }
135
136 void Animation::executeInstruction()
137 {

Callers 2

LoadClassAnimationFunction · 0.80
loadMethod · 0.80

Calls 15

loadMetaMethod · 0.95
loadImagesMethod · 0.95
loadGroupsMethod · 0.95
loadCodeMethod · 0.95
from_fileFunction · 0.85
getAnimationTemplatesFunction · 0.85
debugMethod · 0.80
lastMethod · 0.80
traceMethod · 0.80
nestMethod · 0.80

Tested by

no test coverage detected