diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 17:02:18 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 17:02:18 +0100 |
commit | 715be63e514066fec1962f47f85d0754cbf37755 (patch) | |
tree | 5c3bf3728cce9413be36f20021ffbe511bbba20f /src/crepe/api/Sprite.cpp | |
parent | 9b337ae01e4f3efc6ad3be5af33e3df8e9224d71 (diff) | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/api/Sprite.cpp')
-rw-r--r-- | src/crepe/api/Sprite.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index cc0e20a..ba684ba 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -1,26 +1,21 @@ #include <cmath> -#include <utility> #include "../util/Log.h" +#include "api/Asset.h" #include "Component.h" #include "Sprite.h" -#include "Texture.h" #include "types.h" using namespace std; using namespace crepe; -Sprite::Sprite(game_object_id_t id, Texture & texture, const Sprite::Data & data) +Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & data) : Component(id), - texture(std::move(texture)), + 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; } Sprite::~Sprite() { dbg_trace(); } |