Arreglos en la estructura i format del codi

This commit is contained in:
2025-03-01 17:01:50 +01:00
parent 3562b139c3
commit 31cded15cc
35 changed files with 496 additions and 755 deletions

View File

@@ -1,9 +1,9 @@
#include "debug.h"
#include <algorithm> // for max
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "text.h" // for Text
#include "utils.h" // for Color
#include <algorithm> // for max
#include "resource.h" // for Resource
#include "screen.h" // for Screen
#include "text.h" // for Text
#include "utils.h" // for Color
// [SINGLETON]
Debug *Debug::debug_ = nullptr;
@@ -28,19 +28,9 @@ Debug *Debug::get()
// Constructor
Debug::Debug()
// Copia la dirección de los objetos
: screen_(Screen::get()),
renderer_(Screen::get()->getRenderer())
{
// Reserva memoria para los punteros
texture_ = Resource::get()->getTexture("debug.png");
text_ = Resource::get()->getText("debug");
}
// Actualiza las variables
void Debug::update()
{
}
renderer_(Screen::get()->getRenderer()),
text_(Resource::get()->getText("debug")) {}
// Dibuja en pantalla
void Debug::render()
@@ -48,7 +38,7 @@ void Debug::render()
int y = y_;
int w = 0;
for (auto s : slot_)
for (const auto &s : slot_)
{
text_->write(x_, y, s);
w = (std::max(w, (int)s.length()));
@@ -61,7 +51,7 @@ void Debug::render()
}
y = 0;
for (auto l : log_)
for (const auto &l : log_)
{
text_->writeColored(x_ + 10, y, l, Color(255, 255, 255));
y += text_->getCharacterSize() + 1;