| 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 | { |
nothing calls this directly
no test coverage detected