| 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 | { |
no test coverage detected