| 119 | } |
| 120 | |
| 121 | Transform::UnitVector Texture::getSize() const |
| 122 | { |
| 123 | sf::Vector2u textureSize; |
| 124 | if (std::holds_alternative<sf::Texture>(m_texture)) |
| 125 | { |
| 126 | textureSize = std::get<sf::Texture>(m_texture).getSize(); |
| 127 | } |
| 128 | if (std::holds_alternative<std::shared_ptr<sf::Texture>>(m_texture)) |
| 129 | { |
| 130 | textureSize = std::get<std::shared_ptr<sf::Texture>>(m_texture)->getSize(); |
| 131 | } |
| 132 | if (std::holds_alternative<const sf::Texture*>(m_texture)) |
| 133 | { |
| 134 | textureSize = std::get<const sf::Texture*>(m_texture)->getSize(); |
| 135 | } |
| 136 | return Transform::UnitVector( |
| 137 | textureSize.x, textureSize.y, Transform::Units::ScenePixels); |
| 138 | } |
| 139 | |
| 140 | void Texture::setAntiAliasing(bool antiAliasing) |
| 141 | { |