diff options
author | Stephen Enders <smenders@gmail.com> | 2021-01-05 01:16:37 -0500 |
---|---|---|
committer | Stephen Enders <smenders@gmail.com> | 2021-01-05 01:16:37 -0500 |
commit | 1dbd3c241ea6af43a26449e515438cc241de46ad (patch) | |
tree | 5a0db7bacaa4802d3980a25d9df5998df5c49b46 | |
parent | 443d7ec4b25da99a52c9b3b06fb1d954b060a912 (diff) |
Pass reference when passing objects!
-rw-r--r-- | helper.cpp | 4 | ||||
-rw-r--r-- | helper.h | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -39,7 +39,7 @@ sf::Font loadFont() } std::shared_ptr<struct piece_t> -createPiece(int id, sf::Texture texture) +createPiece(int id, sf::Texture& texture) { sf::Sprite s(texture); @@ -51,7 +51,7 @@ createPiece(int id, sf::Texture texture) } std::shared_ptr<struct player_t> -createPlayer(sf::Texture texture) +createPlayer(sf::Texture& texture) { std::shared_ptr<struct player_t> player = std::make_shared<struct player_t>(); player->score = 0; @@ -35,10 +35,10 @@ loadTextures(const char* path); sf::Font loadFont(); std::shared_ptr<struct player_t> -createPlayer(sf::Texture pieceTexture); +createPlayer(sf::Texture& pieceTexture); std::shared_ptr<struct piece_t> -createPiece(int id, sf::Texture texture); +createPiece(int id, sf::Texture& texture); bool clickedPiece(sf::Vector2i mousePosition, std::shared_ptr<struct piece_t> piece); |