| 78 | } |
| 79 | |
| 80 | std::shared_ptr<Graphics::Font> ResourceManager::getFont(const std::string& path) |
| 81 | { |
| 82 | if (m_fonts.find(path) == m_fonts.end()) |
| 83 | { |
| 84 | std::shared_ptr<Graphics::Font> tempFont = std::make_shared<Graphics::Font>(); |
| 85 | const System::LoaderResult loadResult |
| 86 | = System::Path(path).load(System::Loaders::fontLoader, *tempFont); |
| 87 | Debug::Log->debug( |
| 88 | "[ResourceManager] Loading <Font> {} from {}", path, loadResult.path()); |
| 89 | |
| 90 | if (loadResult.success()) |
| 91 | m_fonts[path] = move(tempFont); |
| 92 | else |
| 93 | throw Exceptions::FontNotFound( |
| 94 | path, System::MountablePath::StringPaths(), EXC_INFO); |
| 95 | } |
| 96 | return m_fonts[path]; |
| 97 | } |
| 98 | |
| 99 | void ResourceManagedObject::removeResourceManager() |
| 100 | { |