Posant make_uniques, s'ha quedat tot enmerdat per culpa d'un struct

This commit is contained in:
2024-10-08 13:53:24 +02:00
parent 9d41d14d68
commit 06a4f439c1
11 changed files with 157 additions and 304 deletions

View File

@@ -14,10 +14,10 @@
Player::Player(int id, float x, int y, bool demo, SDL_Rect *playArea, std::vector<Texture *> texture, std::vector<std::vector<std::string> *> animations)
{
// Reserva memoria para los objetos
playerSprite = std::unique_ptr<AnimatedSprite>(new AnimatedSprite(texture[0], "", animations[0]));
powerSprite = std::unique_ptr<AnimatedSprite>(new AnimatedSprite(texture[1], "", animations[1]));
playerSprite = std::make_unique<AnimatedSprite>(texture[0], "", animations[0]);
powerSprite = std::make_unique<AnimatedSprite>(texture[1], "", animations[1]);
powerSprite->getTexture()->setAlpha(224);
enterName = std::unique_ptr<EnterName>(new EnterName());
enterName = std::make_unique<EnterName>();
// Rectangulo con la zona de juego
this->playArea = playArea;