diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-22 15:37:00 +0200 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-22 15:37:00 +0200 |
commit | f1857fc2d4ddec71b3f0395903f8446cf96b8d0c (patch) | |
tree | feb0a1b4f80cb67ca9af89545ae67a2c03e2f23b /src/crepe/api/Sprite.h | |
parent | b151274f9009eb9f86e4df29ca2c75f5b01d4092 (diff) |
fixed everything and can now work with new compiler, example rendering and made it work with component manager
Diffstat (limited to 'src/crepe/api/Sprite.h')
-rw-r--r-- | src/crepe/api/Sprite.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h index 84eeb83..3dd9b4a 100644 --- a/src/crepe/api/Sprite.h +++ b/src/crepe/api/Sprite.h @@ -2,26 +2,28 @@ #include "Component.h" #include "api/Color.h" -#include "facade/Texture.h" +#include "api/Texture.h" +#include <SDL2/SDL_rect.h> #include <cstdint> +#include <memory> namespace crepe::api { struct flip_settings{ - bool flipX : 1; - bool flipY : 1; + bool flip_x: 1; + bool flip_y : 1; }; class Sprite : public Component { public: - Sprite(crepe::Texture& image, const Color& color, const flip_settings& flip ) : sprite_image(&image), color(color), flip(flip){} - crepe::Texture* sprite_image; + Sprite(std::unique_ptr<Texture> image, const Color& color, const flip_settings& flip ); + ~Sprite(); + std::unique_ptr<Texture> sprite_image; Color color; flip_settings flip; - uint8_t sortingLayer; - uint8_t orderInLayer; - + uint8_t sorting_in_layer; + uint8_t order_in_layer; }; |