Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1.  
  2. ===============================================1===========================================================
  3. for ( auto text = textures.begin(); text != textures.end(); ++text )
  4. {
  5. *text = std::make_unique<sf::Texture>();
  6.  
  7. if ( text == textures.begin() )
  8. {
  9. (*text)->loadFromFile(PATH_TO_BACKGROUND + "Menu" + EXTENSION);
  10. continue;
  11. }
  12.  
  13. (*text)->loadFromFile(PATH_TO_BACKGROUND + std::to_string(std::distance(textures.begin(), text)) + EXTENSION);
  14.  
  15. }
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. ===============================================2===========================================================
  26. /*
  27. for ( size_t i = 0; i < BACKGROUND_COUNT; ++i )
  28. {
  29. textures[i] = new sf::Texture();
  30.  
  31. if ( i == 0 )
  32. {
  33. textures[i]->loadFromFile(PATH_TO_BACKGROUND + "Menu" + EXTENSION);
  34. continue;
  35. }
  36.  
  37. textures[i]->loadFromFile(PATH_TO_BACKGROUND + std::to_string(i) + EXTENSION);
  38. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement