unificats els resources en un namespace

This commit is contained in:
2025-11-11 10:04:57 +01:00
parent 1821b84e73
commit 54fc6d2902
35 changed files with 356 additions and 341 deletions

View File

@@ -5,9 +5,9 @@
#include <algorithm> // Para clamp
#include <iostream> // Para std::cout
#include "core/resources/resource.hpp" // Para Resource
#include "external/jail_audio.h" // Para JA_FadeOutMusic, JA_Init, JA_PauseM...
#include "game/options.hpp" // Para AudioOptions, audio, MusicOptions
#include "core/resources/resource_cache.hpp" // Para Resource
#include "external/jail_audio.h" // Para JA_FadeOutMusic, JA_Init, JA_PauseM...
#include "game/options.hpp" // Para AudioOptions, audio, MusicOptions
// Singleton
Audio* Audio::instance = nullptr;
@@ -44,7 +44,7 @@ void Audio::playMusic(const std::string& name, const int loop) {
}
// Intentar obtener recurso; si falla, no tocar estado
auto* resource = Resource::get()->getMusic(name);
auto* resource = Resource::Cache::get()->getMusic(name);
if (resource == nullptr) {
// manejo de error opcional
return;
@@ -91,7 +91,7 @@ void Audio::stopMusic() {
// Reproduce un sonido por nombre
void Audio::playSound(const std::string& name, Group group) const {
if (sound_enabled_) {
JA_PlaySound(Resource::get()->getSound(name), 0, static_cast<int>(group));
JA_PlaySound(Resource::Cache::get()->getSound(name), 0, static_cast<int>(group));
}
}