diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-12 07:59:47 +0100 |
commit | 0f68177a0384d41a7feff36cc0e1869b6d2ac9aa (patch) | |
tree | 4904b60820858efd0ee6ece0af1f2c1fc5846ec5 /src/crepe/api/Sprite.cpp | |
parent | 73f8d5c558ebc0820ede241e64a876ff1c5ccefb (diff) | |
parent | 194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/inputSystem
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(); } |