///////////////////////////////////////////////////////
| 53 | { |
| 54 | //////////////////////////////////////////////////////////// |
| 55 | void Shape::setTexture(const Texture* texture, bool resetRect) |
| 56 | { |
| 57 | if (texture) |
| 58 | { |
| 59 | // Recompute the texture area if requested, or if there was no texture & rect before |
| 60 | if (resetRect || (!m_texture && (m_textureRect == IntRect()))) |
| 61 | setTextureRect(IntRect({0, 0}, Vector2i(texture->getSize()))); |
| 62 | } |
| 63 | |
| 64 | // Assign the new texture |
| 65 | m_texture = texture; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | //////////////////////////////////////////////////////////// |
no test coverage detected