Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Sprite::setTexture() subrect behaviour  (Read 3708 times)

0 Members and 1 Guest are viewing this topic.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
sf::Sprite::setTexture() subrect behaviour
« on: August 24, 2012, 11:55:47 am »
When one calls sf::Sprite::setTexture( ..., false ) the first time (i.e. first time a texture is set), the subrect will be reset, even when that's not intended.

This can lead to problems when one's preparing the subrect before actually setting the texture the first time.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Sprite::setTexture() subrect behaviour
« Reply #1 on: August 24, 2012, 12:19:11 pm »
Do you suggest to reset it only if it hasn't been set before calling setTexture?
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: sf::Sprite::setTexture() subrect behaviour
« Reply #2 on: August 24, 2012, 12:29:32 pm »
Correct. If I set the subrect, I probably want to keep it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Sprite::setTexture() subrect behaviour
« Reply #3 on: August 24, 2012, 04:17:55 pm »
Sounds reasonable. Done.
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: sf::Sprite::setTexture() subrect behaviour
« Reply #4 on: August 27, 2012, 11:23:50 am »
Thanks!

 

anything