| 96 | } |
| 97 | |
| 98 | void Sprite::loadTexture(const std::string& path) |
| 99 | { |
| 100 | if (!path.empty() and path != m_path) |
| 101 | { |
| 102 | m_path = path; |
| 103 | if (m_resources) |
| 104 | { |
| 105 | m_texture = m_resources->getTexture(path, m_antiAliasing); |
| 106 | } |
| 107 | else |
| 108 | { |
| 109 | m_texture.reset(); |
| 110 | m_texture.loadFromFile(System::Path(path).find()); |
| 111 | m_texture.setAntiAliasing(m_antiAliasing); |
| 112 | } |
| 113 | |
| 114 | m_sprite.setTexture(m_texture); |
| 115 | m_sprite.setTextureRect( |
| 116 | sf::IntRect(0, 0, m_texture.getSize().x, m_texture.getSize().y)); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void Sprite::resetUnit(Transform::Units unit) |
| 121 | { |
no test coverage detected