Trabajando en la precarga de animaciones

This commit is contained in:
2022-10-27 14:04:30 +02:00
parent 9d9d9d92f2
commit 6186d1fac1
4 changed files with 159 additions and 9 deletions

View File

@@ -25,10 +25,12 @@ struct t_animation
struct animatedSprite_t
{
std::vector<t_animation> animations; // Vector con las diferentes animaciones
Texture *texture; // Textura con los graficos para el sprite
SDL_Renderer *renderer; // Renderizador para el sprite
Texture *texture; // Textura con los graficos para el sprite
};
// Carga la animación desde un fichero
animatedSprite_t loadFromFile(Texture *texture, std::string filePath);
class AnimatedSprite : public MovingSprite
{
private:
@@ -39,7 +41,7 @@ private:
public:
// Constructor
AnimatedSprite(Texture *texture = nullptr, SDL_Renderer *renderer = nullptr, std::string file = "", std::vector<std::string> *buffer = nullptr);
AnimatedSprite(animatedSprite_t as);
AnimatedSprite(SDL_Renderer *renderer, animatedSprite_t as);
// Destructor
~AnimatedSprite();