forked from jaildesigner-jailgames/jaildoctors_dilemma
canvi de pc enmig de la enfangà
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "texture.h" // Para Texture
|
||||
#include "utils.h"
|
||||
#include "screen.h"
|
||||
#include "asset.h"
|
||||
#include "resource.h"
|
||||
|
||||
// [SINGLETON]
|
||||
Debug *Debug::debug_ = nullptr;
|
||||
@@ -32,19 +32,11 @@ Debug *Debug::get()
|
||||
Debug::Debug()
|
||||
// Copia la dirección de los objetos
|
||||
: screen_(Screen::get()),
|
||||
renderer_(Screen::get()->getRenderer()),
|
||||
asset_(Asset::get())
|
||||
renderer_(Screen::get()->getRenderer())
|
||||
{
|
||||
// Reserva memoria para los punteros
|
||||
texture_ = new Texture(renderer_, asset_->get("debug.png"));
|
||||
text_ = new Text(asset_->get("debug.txt"), texture_, renderer_);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Debug::~Debug()
|
||||
{
|
||||
delete texture_;
|
||||
delete text_;
|
||||
texture_ = Resource::get()->getTexture("debug.png");
|
||||
text_ = Resource::get()->getText("debug.txt");
|
||||
}
|
||||
|
||||
// Actualiza las variables
|
||||
@@ -83,46 +75,4 @@ void Debug::setPos(SDL_Point p)
|
||||
{
|
||||
x_ = p.x;
|
||||
y_ = p.y;
|
||||
}
|
||||
|
||||
// Añade un texto para mostrar
|
||||
void Debug::add(std::string text)
|
||||
{
|
||||
slot_.push_back(text);
|
||||
}
|
||||
|
||||
// Borra la información de debug
|
||||
void Debug::clear()
|
||||
{
|
||||
slot_.clear();
|
||||
}
|
||||
|
||||
// Añade un texto para mostrar en el apartado log
|
||||
void Debug::addToLog(std::string text)
|
||||
{
|
||||
log_.push_back(text);
|
||||
}
|
||||
|
||||
// Borra la información de debug del apartado log
|
||||
void Debug::clearLog()
|
||||
{
|
||||
log_.clear();
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Debug::setEnabled(bool value)
|
||||
{
|
||||
enabled_ = value;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool Debug::getEnabled()
|
||||
{
|
||||
return enabled_;
|
||||
}
|
||||
|
||||
// Cambia el valor de la variable
|
||||
void Debug::switchEnabled()
|
||||
{
|
||||
enabled_ = !enabled_;
|
||||
}
|
||||
Reference in New Issue
Block a user