Transició a surface: vaig per title.cpp

This commit is contained in:
2025-03-02 21:56:19 +01:00
parent db3a0d7263
commit 8f1d1df5d6
27 changed files with 416 additions and 490 deletions

View File

@@ -1,18 +1,18 @@
// IWYU pragma: no_include <bits/std_abs.h>
#include "player.h"
#include <stdlib.h> // for rand
#include <algorithm> // for max, min
#include <cmath> // for ceil, abs
#include "animated_sprite.h" // for AnimatedSprite
#include "debug.h" // for Debug
#include "defines.h" // for BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT
#include "input.h" // for Input, InputAction
#include "jail_audio.h" // for JA_PlaySound
#include "options.h" // for Options, options, Cheat, OptionsVideo
#include "resource.h" // for Resource
#include "room.h" // for Room, JA_Sound_t, TileType
#include "screen.h" // for Screen
#include "texture.h" // for Texture
#include <stdlib.h> // for rand
#include <algorithm> // for max, min
#include <cmath> // for ceil, abs
#include "s_animated_sprite.h" // for AnimatedSprite
#include "debug.h" // for Debug
#include "defines.h" // for BORDER_BOTTOM, BORDER_LEFT, BORDER_RIGHT
#include "input.h" // for Input, InputAction
#include "jail_audio.h" // for JA_PlaySound
#include "options.h" // for Options, options, Cheat, OptionsVideo
#include "resource.h" // for Resource
#include "room.h" // for Room, JA_Sound_t, TileType
#include "screen.h" // for Screen
#include "surface.h" // for Texture
// Constructor
Player::Player(const PlayerData &player)
@@ -715,7 +715,7 @@ void Player::applySpawnValues(const PlayerSpawn &spawn)
// Inicializa el sprite del jugador
void Player::initSprite(const std::string &texture_path, const std::string &animations_path)
{
auto texture = Resource::get()->getTexture(texture_path);
auto texture = Resource::get()->getSurface(texture_path);
auto animations = Resource::get()->getAnimations(animations_path);
sprite_ = std::make_shared<AnimatedSprite>(texture, animations);