This commit is contained in:
2025-11-19 20:21:45 +01:00
parent cbe71b5af4
commit 35ef99cf7c
25 changed files with 397 additions and 462 deletions

View File

@@ -71,10 +71,10 @@ class Screen {
private:
// Estructuras
struct DisplayMonitor {
std::string name{};
int width{0};
int height{0};
int refresh_rate{0};
std::string name;
int width{0};
int height{0};
int refresh_rate{0};
};
struct FPS {

View File

@@ -54,7 +54,7 @@ auto SurfaceAnimatedSprite::loadAnimationsFromYAML(const std::string& file_path,
// --- Parse global configuration ---
if (yaml.contains("tileSetFile")) {
std::string tile_set_file = yaml["tileSetFile"].get_value<std::string>();
auto tile_set_file = yaml["tileSetFile"].get_value<std::string>();
surface = Resource::Cache::get()->getSurface(tile_set_file);
}
@@ -137,7 +137,7 @@ SurfaceAnimatedSprite::SurfaceAnimatedSprite(const AnimationResource& cached_dat
// --- Parse global configuration ---
if (yaml.contains("tileSetFile")) {
std::string tile_set_file = yaml["tileSetFile"].get_value<std::string>();
auto tile_set_file = yaml["tileSetFile"].get_value<std::string>();
// Ahora SÍ podemos acceder al cache (ya está completamente cargado)
surface_ = Resource::Cache::get()->getSurface(tile_set_file);
}

View File

@@ -18,7 +18,7 @@ class SurfaceAnimatedSprite : public SurfaceMovingSprite {
// Estructura pública de datos de animación
struct AnimationData {
std::string name{}; // Nombre de la animacion
std::string name; // Nombre de la animacion
std::vector<SDL_FRect> frames; // Cada uno de los frames que componen la animación
float speed{0.083F}; // Velocidad de la animación (segundos por frame)
int loop{0}; // Indica a que frame vuelve la animación al terminar. -1 para que no vuelva