neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper

This commit is contained in:
2026-05-14 20:22:54 +02:00
parent 88fa3f296f
commit 1912200b21
40 changed files with 699 additions and 578 deletions
+8 -8
View File
@@ -25,10 +25,10 @@ struct animatedSprite_t {
};
// Carga la animación desde un fichero
animatedSprite_t loadAnimationFromFile(Texture *texture, const std::string &filePath, bool verbose = false);
auto loadAnimationFromFile(Texture *texture, const std::string &filePath, bool verbose = false) -> animatedSprite_t;
// Carga la animación desde bytes en memoria
animatedSprite_t loadAnimationFromMemory(Texture *texture, const std::vector<uint8_t> &bytes, const std::string &nameForLogs = "", bool verbose = false);
auto loadAnimationFromMemory(Texture *texture, const std::vector<uint8_t> &bytes, const std::string &nameForLogs = "", bool verbose = false) -> animatedSprite_t;
class AnimatedSprite : public MovingSprite {
private:
@@ -48,7 +48,7 @@ class AnimatedSprite : public MovingSprite {
void animate();
// Obtiene el numero de frames de la animación actual
int getNumFrames();
auto getNumFrames() -> int;
// Establece el frame actual de la animación
void setCurrentFrame(int num);
@@ -69,17 +69,17 @@ class AnimatedSprite : public MovingSprite {
void setAnimationCompleted(int index, bool value);
// Comprueba si ha terminado la animación
bool animationIsCompleted();
auto animationIsCompleted() -> bool;
// Devuelve el rectangulo de una animación y frame concreto
SDL_Rect getAnimationClip(const std::string &name = "default", Uint8 index = 0);
SDL_Rect getAnimationClip(int indexA = 0, Uint8 indexF = 0);
auto getAnimationClip(const std::string &name = "default", Uint8 index = 0) -> SDL_Rect;
auto getAnimationClip(int indexA = 0, Uint8 indexF = 0) -> SDL_Rect;
// Obtiene el indice de la animación a partir del nombre
int getIndex(const std::string &name);
auto getIndex(const std::string &name) -> int;
// Carga la animación desde un vector
bool loadFromVector(std::vector<std::string> *source);
auto loadFromVector(std::vector<std::string> *source) -> bool;
// Establece la animacion actual
void setCurrentAnimation(const std::string &name = "default");