Animaciones precacheadas

This commit is contained in:
2022-10-27 18:42:07 +02:00
parent 35b4d19188
commit 1934f790f7
9 changed files with 20 additions and 15 deletions

View File

@@ -15,8 +15,8 @@ Player::Player(player_t ini, std::string png, std::string animation, SDL_Rendere
this->options = options;
// Crea objetos
texture = resource->getTexture(png);
sprite = new AnimatedSprite(texture, renderer, animation);
//texture = resource->getTexture(png);
sprite = new AnimatedSprite(renderer, resource->getAnimation(animation));
// Inicializa variables
color = stringToColor(options->palette, "white");
@@ -688,7 +688,8 @@ player_t Player::getSpawnParams()
// Recarga la textura
void Player::reLoadTexture()
{
texture->reLoad();
sprite->getTexture()->reLoad();
//texture->reLoad();
}
// Recarga la paleta