Menudo puto lio de renamar coses, a vore si tot va quedant al lloc que els structs i els enums estan revolant i duplicats per tots llocs

This commit is contained in:
2024-10-11 20:12:50 +02:00
parent a9ca23138d
commit 3a6950f3a4
28 changed files with 445 additions and 454 deletions

View File

@@ -5,17 +5,17 @@ Writer::Writer(std::shared_ptr<Text> text)
: text_(text)
{
// Inicializa variables
posX_ = 0;
posY_ = 0;
pos_x_ = 0;
pos_y_ = 0;
kerning_ = 0;
caption_ = "";
speed_ = 0;
writingCounter_ = 0;
writing_counter_ = 0;
index_ = 0;
lenght_ = 0;
completed_ = false;
enabled_ = false;
enabledCounter_ = 0;
enabled_counter_ = 0;
finished_ = false;
}
@@ -27,15 +27,14 @@ void Writer::update()
if (!completed_)
{
// No completado
if (writingCounter_ > 0)
if (writing_counter_ > 0)
{
writingCounter_--;
writing_counter_--;
}
else if (writingCounter_ == 0)
else
{
index_++;
writingCounter_ = speed_;
writing_counter_ = speed_;
}
if (index_ == lenght_)
@@ -43,18 +42,10 @@ void Writer::update()
completed_ = true;
}
}
else
{
// Completado
if (enabledCounter_ > 0)
{
enabledCounter_--;
}
else if (enabledCounter_ == 0)
{
finished_ = true;
}
enabled_counter_ > 0 ? enabled_counter_-- : finished_ = true;
}
}
}
@@ -64,20 +55,20 @@ void Writer::render() const
{
if (enabled_)
{
text_->write(posX_, posY_, caption_, kerning_, index_);
text_->write(pos_x_, pos_y_, caption_, kerning_, index_);
}
}
// Establece el valor de la variable
void Writer::setPosX(int value)
{
posX_ = value;
pos_x_ = value;
}
// Establece el valor de la variable
void Writer::setPosY(int value)
{
posY_ = value;
pos_y_ = value;
}
// Establece el valor de la variable
@@ -97,7 +88,7 @@ void Writer::setCaption(std::string text)
void Writer::setSpeed(int value)
{
speed_ = value;
writingCounter_ = value;
writing_counter_ = value;
}
// Establece el valor de la variable
@@ -115,7 +106,7 @@ bool Writer::IsEnabled() const
// Establece el valor de la variable
void Writer::setFinishedCounter(int time)
{
enabledCounter_ = time;
enabled_counter_ = time;
}
// Centra la cadena de texto a un punto X