| 60 | } |
| 61 | |
| 62 | bool Texture::loadFromFile(const std::string& filename) |
| 63 | { |
| 64 | if (std::holds_alternative<sf::Texture>(m_texture)) |
| 65 | { |
| 66 | return std::get<sf::Texture>(m_texture).loadFromFile(filename); |
| 67 | } |
| 68 | if (std::holds_alternative<std::shared_ptr<sf::Texture>>(m_texture)) |
| 69 | { |
| 70 | return std::get<std::shared_ptr<sf::Texture>>(m_texture)->loadFromFile( |
| 71 | filename); |
| 72 | } |
| 73 | if (std::holds_alternative<const sf::Texture*>(m_texture)) |
| 74 | { |
| 75 | throw Exceptions::ReadOnlyTexture("loadFromFile", EXC_INFO); |
| 76 | } |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | bool Texture::loadFromFile(const std::string& filename, const Transform::Rect& rect) |
| 81 | { |
no test coverage detected