This commit is contained in:
2025-10-27 11:53:12 +01:00
parent 231dcd4b3b
commit 5d8811026d
69 changed files with 899 additions and 888 deletions

View File

@@ -8,21 +8,21 @@
#include "utils/utils.hpp" // Para Color
// [SINGLETON]
Debug* Debug::debug_ = nullptr;
Debug* Debug::debug = nullptr;
// [SINGLETON] Crearemos el objeto con esta función estática
void Debug::init() {
Debug::debug_ = new Debug();
Debug::debug = new Debug();
}
// [SINGLETON] Destruiremos el objeto con esta función estática
void Debug::destroy() {
delete Debug::debug_;
delete Debug::debug;
}
// [SINGLETON] Con este método obtenemos el objeto y podemos trabajar con él
Debug* Debug::get() {
return Debug::debug_;
return Debug::debug;
}
// Dibuja en pantalla

View File

@@ -9,7 +9,7 @@
class Debug {
private:
// [SINGLETON] Objeto privado
static Debug* debug_;
static Debug* debug;
// Variables
std::vector<std::string> slot_; // Vector con los textos a escribir
@@ -41,7 +41,7 @@ class Debug {
void setPos(SDL_FPoint p);
// Getters
bool getEnabled() { return enabled_; }
bool getEnabled() const { return enabled_; }
// Setters
void add(std::string text) { slot_.push_back(text); }

View File

@@ -5,7 +5,7 @@
#include "core/input/mouse.hpp"
#include "game/options.hpp" // Para Options, options, OptionsGame, OptionsAudio
namespace globalEvents {
namespace GlobalEvents {
// Comprueba los eventos que se pueden producir en cualquier sección del juego
void check(const SDL_Event& event) {
// Evento de salida de la aplicación
@@ -20,4 +20,4 @@ void check(const SDL_Event& event) {
Mouse::handleEvent(event);
}
} // namespace globalEvents
} // namespace GlobalEvents

View File

@@ -2,7 +2,7 @@
#include <SDL3/SDL.h>
namespace globalEvents {
namespace GlobalEvents {
// Comprueba los eventos que se pueden producir en cualquier sección del juego
void check(const SDL_Event& event);
} // namespace globalEvents
} // namespace GlobalEvents