diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:37:23 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:37:23 +0100 |
commit | ca6c4f30df6612f60db0fdfe4c2d366d7e4da8ea (patch) | |
tree | 199878898c2ddcdd2f7f6a1b76c165c2c7db5c8d /src/crepe/api/Sprite.cpp | |
parent | f0ecbea57a4d75905c4ee79608807187cd8f3e72 (diff) | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) |
merge master
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(); } |