| 84 | } |
| 85 | |
| 86 | std::string DirectXDataManager::getDataPath(const std::string& _name) const |
| 87 | { |
| 88 | VectorString result; |
| 89 | common::VectorWString wresult; |
| 90 | |
| 91 | for (const auto& path : mPaths) |
| 92 | { |
| 93 | common::scanFolder(wresult, path.name, path.recursive, MyGUI::UString(_name).asWStr(), true); |
| 94 | } |
| 95 | |
| 96 | for (const auto& file : wresult) |
| 97 | { |
| 98 | result.push_back(MyGUI::UString(file).asUTF8()); |
| 99 | } |
| 100 | |
| 101 | if (!result.empty()) |
| 102 | { |
| 103 | const std::string& path = result[0]; |
| 104 | if (result.size() > 1) |
| 105 | { |
| 106 | MYGUI_PLATFORM_LOG( |
| 107 | Warning, |
| 108 | "There are several files with name '" << _name << "'. '" << path << "' was used."); |
| 109 | MYGUI_PLATFORM_LOG(Warning, "Other candidates are:"); |
| 110 | for (size_t index = 1; index < result.size(); index++) |
| 111 | MYGUI_PLATFORM_LOG(Warning, " - '" << result[index] << "'"); |
| 112 | } |
| 113 | return path; |
| 114 | } |
| 115 | |
| 116 | return {}; |
| 117 | } |
| 118 | |
| 119 | void DirectXDataManager::addResourceLocation(const std::string& _name, bool _recursive) |
| 120 | { |
no test coverage detected