unificats els resources en un namespace
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user