aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Sprite.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-09 15:35:36 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-09 15:35:36 +0100
commit33cd5566909ac089cdf56db38a3d1daf0cb7dd10 (patch)
tree1d684595d5e8ef88c6c874ced36e616786231dd0 /src/crepe/api/Sprite.cpp
parent519cc5d16e65ff501d330c03eeb35d2d095ead29 (diff)
fixed the aspect ratio and removed the ratio from sprite and give it to texture. however the problem still lies with if animator is given the aspect ratio is then off
Diffstat (limited to 'src/crepe/api/Sprite.cpp')
-rw-r--r--src/crepe/api/Sprite.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp
index 4cf214c..ba684ba 100644
--- a/src/crepe/api/Sprite.cpp
+++ b/src/crepe/api/Sprite.cpp
@@ -10,16 +10,12 @@
using namespace std;
using namespace crepe;
-Sprite::Sprite(game_object_id_t id, const Asset & texture, const ivec2 & size, const Sprite::Data & data)
+Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & data)
: Component(id),
source(texture),
data(data) {
dbg_trace();
-
- 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(); }