summaryrefslogtreecommitdiff
path: root/sprite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sprite.cpp')
-rw-r--r--sprite.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/sprite.cpp b/sprite.cpp
index 260c54f..493864e 100644
--- a/sprite.cpp
+++ b/sprite.cpp
@@ -1,8 +1,15 @@
#include "sprite.h"
-Sprite::Sprite(const unsigned char *image,unsigned int image_len)
- :image(image),image_len(image_len){
+Sprite::Sprite(const unsigned char *image,unsigned int image_len){
sf_texture.loadFromMemory(image,image_len);
sf_sprite.setTexture(sf_texture);
}
+
+int Sprite::width() const {
+ return sf_texture.getSize().x;
+}
+
+int Sprite::height() const {
+ return sf_texture.getSize().y;
+}