aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Sprite.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-06 19:26:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-06 19:26:27 +0100
commite8d9e38b4c265e0efde32c38d01b511cb572a34d (patch)
tree0af9b8f5e7c9e59de2e3c9ebc175ce31e9a86c20 /src/crepe/api/Sprite.cpp
parentcfd578dd0b7d5894ff0b0a0796d85cd5e9ae6e56 (diff)
parentf3adf300c5ba9b382f74e5b704501fd047399062 (diff)
Merge branch 'niels/decoupling_pixel_and_pos' of github.com:lonkaars/crepe
Diffstat (limited to 'src/crepe/api/Sprite.cpp')
-rw-r--r--src/crepe/api/Sprite.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp
index 0a2ad4c..cc0e20a 100644
--- a/src/crepe/api/Sprite.cpp
+++ b/src/crepe/api/Sprite.cpp
@@ -6,24 +6,20 @@
#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 & image, const Color & color,
- const FlipSettings & flip, int sort_layer, int order_layer, int height)
+Sprite::Sprite(game_object_id_t id, Texture & texture, const Sprite::Data & data)
: Component(id),
- color(color),
- flip(flip),
- sprite_image(std::move(image)),
- sorting_in_layer(sort_layer),
- order_in_layer(order_layer),
- height(height) {
+ texture(std::move(texture)),
+ data(data) {
dbg_trace();
- this->mask.w = sprite_image.get_size().x;
- this->mask.h = sprite_image.get_size().y;
+ 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;
}