diff options
Diffstat (limited to 'src/crepe/api/Sprite.cpp')
-rw-r--r-- | src/crepe/api/Sprite.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index bae5ad9..4cf214c 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -1,5 +1,4 @@ #include <cmath> -#include <utility> #include "../util/Log.h" #include "api/Asset.h" @@ -11,16 +10,16 @@ using namespace std; using namespace crepe; -Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & data) +Sprite::Sprite(game_object_id_t id, const Asset & texture, const ivec2 & size, const Sprite::Data & data) : Component(id), source(texture), data(data) { dbg_trace(); - //this->mask.w = this->texture.get_size().x; - //this->mask.h = this->texture.get_size().y; - //this->aspect_ratio = static_cast<double>(this->mask.w) / this->mask.h; + this->mask.w = size.x; + this->mask.h = size.y; + this->aspect_ratio = static_cast<double>(this->mask.w) / this->mask.h; } Sprite::~Sprite() { dbg_trace(); } |