Arreglos en la estructura i format del codi
This commit is contained in:
@@ -26,35 +26,30 @@ Debug *Debug::get()
|
||||
return Debug::debug_;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Debug::Debug()
|
||||
: screen_(Screen::get()),
|
||||
renderer_(Screen::get()->getRenderer()),
|
||||
text_(Resource::get()->getText("debug")) {}
|
||||
|
||||
// Dibuja en pantalla
|
||||
void Debug::render()
|
||||
{
|
||||
auto text = Resource::get()->getText("debug");
|
||||
int y = y_;
|
||||
int w = 0;
|
||||
|
||||
for (const auto &s : slot_)
|
||||
{
|
||||
text_->write(x_, y, s);
|
||||
text->write(x_, y, s);
|
||||
w = (std::max(w, (int)s.length()));
|
||||
y += text_->getCharacterSize() + 1;
|
||||
if (y > 192 - text_->getCharacterSize())
|
||||
y += text->getCharacterSize() + 1;
|
||||
if (y > 192 - text->getCharacterSize())
|
||||
{
|
||||
y = y_;
|
||||
x_ += w * text_->getCharacterSize() + 2;
|
||||
x_ += w * text->getCharacterSize() + 2;
|
||||
}
|
||||
}
|
||||
|
||||
y = 0;
|
||||
for (const auto &l : log_)
|
||||
{
|
||||
text_->writeColored(x_ + 10, y, l, Color(255, 255, 255));
|
||||
y += text_->getCharacterSize() + 1;
|
||||
text->writeColored(x_ + 10, y, l, Color(255, 255, 255));
|
||||
y += text->getCharacterSize() + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user