Limpieza y organización de código

This commit is contained in:
2022-10-19 10:34:33 +02:00
parent 7288792940
commit d5dfc952c2
13 changed files with 19 additions and 140 deletions

View File

@@ -38,12 +38,6 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options, i
anchor.middle = gameCanvasHeight / 2;
}
// Destructor
Screen::~Screen()
{
renderer = nullptr;
}
// Limpia la pantalla
void Screen::clean(color_t color)
{
@@ -293,30 +287,12 @@ void Screen::iniSpectrumFade()
spectrumColor.clear();
color_t c;
c = stringToColor("black");
spectrumColor.push_back(c);
c = stringToColor("blue");
spectrumColor.push_back(c);
c = stringToColor("red");
spectrumColor.push_back(c);
c = stringToColor("magenta");
spectrumColor.push_back(c);
c = stringToColor("green");
spectrumColor.push_back(c);
c = stringToColor("cyan");
spectrumColor.push_back(c);
c = stringToColor("yellow");
spectrumColor.push_back(c);
c = stringToColor("bright_white");
spectrumColor.push_back(c);
// Inicializa el vector de colores
const std::vector<std::string> vColors = {"black", "blue", "red", "magenta", "green", "cyan", "yellow", "bright_white"};
for (auto v : vColors)
{
spectrumColor.push_back(stringToColor(v));
}
}
// Actualiza el spectrum fade

View File

@@ -70,9 +70,6 @@ public:
// Constructor
Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options, int gameInternalResX, int gameInternalResY);
// Destructor
~Screen();
// Limpia la pantalla
void clean(color_t color = {0x00, 0x00, 0x00});

View File

@@ -47,13 +47,6 @@ Sprite::Sprite(SDL_Rect rect, Texture *texture, SDL_Renderer *renderer)
enabled = true;
}
// Destructor
Sprite::~Sprite()
{
texture = nullptr;
renderer = nullptr;
}
// Muestra el sprite por pantalla
void Sprite::render()
{

View File

@@ -27,9 +27,6 @@ public:
Sprite(int x = 0, int y = 0, int w = 0, int h = 0, Texture *texture = nullptr, SDL_Renderer *renderer = nullptr);
Sprite(SDL_Rect rect, Texture *texture, SDL_Renderer *renderer);
// Destructor
~Sprite();
// Muestra el sprite por pantalla
void render();