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

@@ -4,15 +4,13 @@
#include <SDL2/SDL_render.h> // for SDL_Renderer
#include <string> // for basic_string, string
#include <vector> // for vector
#include <memory>
#include "utils.h" // for color_t
class Sprite;
class Text;
class Texture;
#include "text.h"
#include "texture.h"
#include "sprite.h"
struct JA_Sound_t;
#ifndef NOTIFY_H
#define NOTIFY_H
class Notify
{
private:
@@ -49,8 +47,8 @@ private:
int counter;
notification_state_e state;
notification_position_e position;
Texture *texture;
Sprite *sprite;
std::unique_ptr<Texture> texture;
std::unique_ptr<Sprite> sprite;
SDL_Rect rect;
int y;
int travelDist;
@@ -59,9 +57,10 @@ private:
// Objetos y punteros
SDL_Renderer *renderer; // El renderizador de la ventana
Texture *textTexture; // Textura para la fuente de las notificaciones
Texture *iconTexture; // Textura para los iconos de las notificaciones
Text *text; // Objeto para dibujar texto
std::unique_ptr<Texture> textTexture; // Textura para la fuente de las notificaciones
std::unique_ptr<Texture> iconTexture; // Textura para los iconos de las notificaciones
std::unique_ptr<Text> text; // Objeto para dibujar texto
// Variables
color_t bgColor; // Color de fondo de las notificaciones
@@ -96,5 +95,3 @@ public:
// Indica si hay notificaciones activas
bool active();
};
#endif