summaryrefslogtreecommitdiff
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/helper.cpp b/helper.cpp
index c16cb3a..97a60a6 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -41,9 +41,8 @@ sf::Font loadFont()
std::shared_ptr<struct piece_t>
createPiece(int id, sf::Texture texture)
{
- std::shared_ptr<sf::Sprite> s = std::make_shared<sf::Sprite>();
- s->setTexture(texture);
+ sf::Sprite s(texture);
auto p = std::make_shared<struct piece_t>();
p->id = id;
p->sprite = s;
@@ -68,7 +67,7 @@ createPlayer(sf::Texture texture)
bool
clickedPiece(sf::Vector2i mousePosition, struct piece_t* piece)
{
- return piece->sprite->getGlobalBounds().contains(mousePosition.x,
+ return piece->sprite.getGlobalBounds().contains(mousePosition.x,
mousePosition.y);
}