Corregits 8.000.000 de segmentation faults en intro.cpp

This commit is contained in:
2024-10-07 18:37:08 +02:00
parent 0330fe6b74
commit bf945ef14b
5 changed files with 48 additions and 53 deletions

View File

@@ -2,11 +2,8 @@
#include "text.h" // for Text
// Constructor
Writer::Writer(Text *text)
Writer::Writer(Text *text) : text(text)
{
// Copia los punteros
this->text = text;
// Inicializa variables
posX = 0;
posY = 0;
@@ -28,7 +25,8 @@ void Writer::update()
if (enabled)
{
if (!completed)
{ // No completado
{
// No completado
if (writingCounter > 0)
{
writingCounter--;
@@ -46,8 +44,9 @@ void Writer::update()
}
}
if (completed)
{ // Completado
else
{
// Completado
if (enabledCounter > 0)
{
enabledCounter--;
@@ -108,7 +107,7 @@ void Writer::setEnabled(bool value)
}
// Obtiene el valor de la variable
bool Writer::IsEnabled()
bool Writer::IsEnabled() const
{
return enabled;
}
@@ -120,7 +119,7 @@ void Writer::setEnabledCounter(int time)
}
// Obtiene el valor de la variable
int Writer::getEnabledCounter()
int Writer::getEnabledCounter() const
{
return enabledCounter;
}
@@ -132,7 +131,7 @@ void Writer::center(int x)
}
// Obtiene el valor de la variable
bool Writer::hasFinished()
bool Writer::hasFinished() const
{
return finished;
}