This commit is contained in:
2025-11-03 09:52:54 +01:00
parent 1409ab5bff
commit 3f1c737247
32 changed files with 254 additions and 243 deletions

View File

@@ -395,7 +395,7 @@ auto Screen::getBorderSurface() -> std::shared_ptr<Surface> { return border_surf
auto loadData(const std::string& filepath) -> std::vector<uint8_t> {
// Load using ResourceHelper (supports both filesystem and pack)
return jdd::ResourceHelper::loadFile(filepath);
return Jdd::ResourceHelper::loadFile(filepath);
}
// Carga el contenido de los archivos GLSL

View File

@@ -21,7 +21,7 @@
// Carga una paleta desde un archivo .gif
auto loadPalette(const std::string& file_path) -> Palette {
// Load file using ResourceHelper (supports both filesystem and pack)
auto buffer = jdd::ResourceHelper::loadFile(file_path);
auto buffer = Jdd::ResourceHelper::loadFile(file_path);
if (buffer.empty()) {
throw std::runtime_error("Error opening file: " + file_path);
}
@@ -48,7 +48,7 @@ auto readPalFile(const std::string& file_path) -> Palette {
palette.fill(0); // Inicializar todo con 0 (transparente por defecto)
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = jdd::ResourceHelper::loadFile(file_path);
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
if (file_data.empty()) {
throw std::runtime_error("No se pudo abrir el archivo .pal: " + file_path);
}
@@ -106,7 +106,7 @@ Surface::Surface(const std::string& file_path)
// Carga una superficie desde un archivo
auto Surface::loadSurface(const std::string& file_path) -> SurfaceData {
// Load file using ResourceHelper (supports both filesystem and pack)
std::vector<Uint8> buffer = jdd::ResourceHelper::loadFile(file_path);
std::vector<Uint8> buffer = Jdd::ResourceHelper::loadFile(file_path);
if (buffer.empty()) {
std::cerr << "Error opening file: " << file_path << '\n';
throw std::runtime_error("Error opening file");

View File

@@ -15,7 +15,7 @@
// Carga las animaciones en un vector(Animations) desde un fichero
auto loadAnimationsFromFile(const std::string& file_path) -> Animations {
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = jdd::ResourceHelper::loadFile(file_path);
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
if (file_data.empty()) {
std::cerr << "Error: Fichero no encontrado " << file_path << '\n';
throw std::runtime_error("Fichero no encontrado: " + file_path);
@@ -43,8 +43,7 @@ auto loadAnimationsFromFile(const std::string& file_path) -> Animations {
}
// Constructor
SurfaceAnimatedSprite::SurfaceAnimatedSprite(const std::string& file_path)
: SurfaceMovingSprite() {
SurfaceAnimatedSprite::SurfaceAnimatedSprite(const std::string& file_path) {
// Carga las animaciones
if (!file_path.empty()) {
Animations v = loadAnimationsFromFile(file_path);
@@ -53,8 +52,7 @@ SurfaceAnimatedSprite::SurfaceAnimatedSprite(const std::string& file_path)
}
// Constructor
SurfaceAnimatedSprite::SurfaceAnimatedSprite(const Animations& animations)
: SurfaceMovingSprite() {
SurfaceAnimatedSprite::SurfaceAnimatedSprite(const Animations& animations) {
if (!animations.empty()) {
setAnimations(animations);
}

View File

@@ -18,8 +18,7 @@ SurfaceMovingSprite::SurfaceMovingSprite(std::shared_ptr<Surface> surface, SDL_F
flip_(SDL_FLIP_NONE) { SurfaceSprite::pos_ = pos; }
SurfaceMovingSprite::SurfaceMovingSprite()
: SurfaceSprite(),
x_(0.0F),
: x_(0.0F),
y_(0.0F),
flip_(SDL_FLIP_NONE) { SurfaceSprite::clear(); }

View File

@@ -28,7 +28,7 @@ auto loadTextFile(const std::string& file_path) -> std::shared_ptr<TextFile> {
}
// Load file using ResourceHelper (supports both filesystem and pack)
auto file_data = jdd::ResourceHelper::loadFile(file_path);
auto file_data = Jdd::ResourceHelper::loadFile(file_path);
if (file_data.empty()) {
std::cerr << "Error: Fichero no encontrado " << getFileName(file_path) << '\n';
throw std::runtime_error("Fichero no encontrado: " + getFileName(file_path));