migrant .ani a .yaml

This commit is contained in:
2025-11-17 13:08:38 +01:00
parent 3c4092df5e
commit 6a6cc22b21
72 changed files with 47 additions and 1050 deletions
+12 -6
View File
@@ -80,13 +80,19 @@ struct ResourceText {
// Estructura para almacenar ficheros animaciones y su nombre
struct ResourceAnimation {
std::string name; // Nombre del fichero
SurfaceAnimatedSprite::Animations animation; // Objeto con las animaciones
std::string name; // Nombre del fichero
std::vector<SurfaceAnimatedSprite::AnimationData> animations; // Datos de animaciones parseadas desde YAML
std::shared_ptr<Surface> surface; // Surface asociada al sprite sheet
float frame_width{0.0F}; // Ancho de cada frame
float frame_height{0.0F}; // Alto de cada frame
// Constructor
ResourceAnimation(std::string name, SurfaceAnimatedSprite::Animations animation)
ResourceAnimation(std::string name, std::vector<SurfaceAnimatedSprite::AnimationData> animations, std::shared_ptr<Surface> surface, float frame_width, float frame_height)
: name(std::move(name)),
animation(std::move(animation)) {}
animations(std::move(animations)),
surface(std::move(surface)),
frame_width(frame_width),
frame_height(frame_height) {}
};
// Estructura para almacenar ficheros con el mapa de tiles de una habitación y su nombre
@@ -244,8 +250,8 @@ class Cache {
// Obtiene el objeto de texto a partir de un nombre
auto getText(const std::string& name) -> std::shared_ptr<Text>;
// Obtiene la animación a partir de un nombre
auto getAnimations(const std::string& name) -> SurfaceAnimatedSprite::Animations&;
// Obtiene los datos de animación parseados a partir de un nombre
auto getAnimationData(const std::string& name) -> const ResourceAnimation&;
// Obtiene el mapa de tiles a partir de un nombre
auto getTileMap(const std::string& name) -> std::vector<int>&;