diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-09 15:35:36 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-09 15:35:36 +0100 |
commit | 33cd5566909ac089cdf56db38a3d1daf0cb7dd10 (patch) | |
tree | 1d684595d5e8ef88c6c874ced36e616786231dd0 /src/crepe/api/Sprite.h | |
parent | 519cc5d16e65ff501d330c03eeb35d2d095ead29 (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.h')
-rw-r--r-- | src/crepe/api/Sprite.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h index 9ef9f03..7e9812d 100644 --- a/src/crepe/api/Sprite.h +++ b/src/crepe/api/Sprite.h @@ -1,10 +1,9 @@ #pragma once #include "../Component.h" +#include "api/Asset.h" #include "Color.h" -#include "Texture.h" -#include "api/Asset.h" #include "types.h" namespace crepe { @@ -75,7 +74,7 @@ public: * \param texture asset of the image * \param ctx all the sprite data */ - Sprite(game_object_id_t id, const Asset & texture, const ivec2 & size, const Data & data); + Sprite(game_object_id_t id, const Asset & texture, const Data & data); ~Sprite(); //! Texture used for the sprite @@ -84,15 +83,6 @@ public: Data data; private: - /** - * \brief ratio of the img - * - * - This will multiply one of \c size variable if it is 0. - * - Will be adjusted if \c Animator component is added to an GameObject that is why this - * value cannot be const. - */ - float aspect_ratio; - //! Reads the mask of sprite friend class SDLContext; |