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

@@ -9,7 +9,7 @@
#include "core/audio/audio.hpp" // Para Audio
#include "core/input/input.hpp" // Para Input, InputAction
#include "core/rendering/surface_animated_sprite.hpp" // Para SAnimatedSprite
#include "core/resources/resource.hpp" // Para Resource
#include "core/resources/resource_cache.hpp" // Para Resource
#include "game/gameplay/room.hpp" // Para Room, TileType
#include "game/options.hpp" // Para Cheat, Options, options
#include "utils/defines.hpp" // Para RoomBorder::BOTTOM, RoomBorder::LEFT, RoomBorder::RIGHT
@@ -585,10 +585,10 @@ void Player::initSounds() {
for (int i = 1; i <= 24; ++i) {
std::string sound_file = "jump" + std::to_string(i) + ".wav";
jumping_sound_.push_back(Resource::get()->getSound(sound_file));
jumping_sound_.push_back(Resource::Cache::get()->getSound(sound_file));
if (i >= 11) {
falling_sound_.push_back(Resource::get()->getSound(sound_file));
falling_sound_.push_back(Resource::Cache::get()->getSound(sound_file));
}
}
}
@@ -607,7 +607,7 @@ void Player::applySpawnValues(const SpawnData& spawn) {
// Inicializa el sprite del jugador
void Player::initSprite(const std::string& animations_path) {
auto animations = Resource::get()->getAnimations(animations_path);
auto animations = Resource::Cache::get()->getAnimations(animations_path);
sprite_ = std::make_unique<SurfaceAnimatedSprite>(animations);
sprite_->setWidth(WIDTH);