Fallo parcial en la carga de animaciones desde streams

This commit is contained in:
2022-10-04 07:09:28 +02:00
parent 95d6396dfa
commit ddb70c8c85
6 changed files with 237 additions and 93 deletions

View File

@@ -6,6 +6,8 @@
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#ifndef ANIMATEDSPRITE_H
#define ANIMATEDSPRITE_H
@@ -29,7 +31,7 @@ private:
public:
// Constructor
AnimatedSprite(LTexture *texture = nullptr, SDL_Renderer *renderer = nullptr, std::string file = "");
AnimatedSprite(LTexture *texture = nullptr, SDL_Renderer *renderer = nullptr, std::string file = "", std::stringstream *stream = nullptr);
// Destructor
~AnimatedSprite();
@@ -66,7 +68,10 @@ public:
int getIndex(std::string name);
// Carga la animación desde un fichero
bool load(std::string filePath);
bool loadFromFile(std::string filePath);
// Carga la animación desde un stream
bool loadFromStream(std::stringstream *stream);
// Establece la animacion actual
void setCurrentAnimation(std::string name = "default");