mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- Fixed: DHUDMessageTypeOnFadeOut::Tick() did not skip over color escapes.
SVN r3566 (trunk)
This commit is contained in:
parent
5bf3b7113e
commit
aa227b1df4
1 changed files with 33 additions and 9 deletions
|
@ -658,11 +658,17 @@ bool DHUDMessageTypeOnFadeOut::Tick ()
|
||||||
{
|
{
|
||||||
if (State == 3)
|
if (State == 3)
|
||||||
{
|
{
|
||||||
LineVisible = (int)(Tics / TypeOnTime);
|
int step = Tics == 0 ? 0 : int(Tics / TypeOnTime) - int((Tics - 1) / TypeOnTime);
|
||||||
while (LineVisible > LineLen && State == 3)
|
int linevis = LineVisible;
|
||||||
|
int linedrawcount = linevis;
|
||||||
|
FString text = Lines[CurrLine].Text;
|
||||||
|
// Advance LineVisible by 'step' *visible* characters
|
||||||
|
while (step > 0 && State == 3)
|
||||||
{
|
{
|
||||||
LineVisible -= LineLen;
|
if (linevis > LineLen)
|
||||||
Tics = (int)(LineVisible * TypeOnTime);
|
{
|
||||||
|
linevis = 0;
|
||||||
|
linedrawcount = 0;
|
||||||
CurrLine++;
|
CurrLine++;
|
||||||
if (CurrLine >= NumLines)
|
if (CurrLine >= NumLines)
|
||||||
{
|
{
|
||||||
|
@ -670,9 +676,27 @@ bool DHUDMessageTypeOnFadeOut::Tick ()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LineLen = (int)Lines[CurrLine].Text.Len();
|
text = Lines[CurrLine].Text;
|
||||||
|
LineLen = (int)text.Len();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (State == 3 && --step >= 0)
|
||||||
|
{
|
||||||
|
linedrawcount++;
|
||||||
|
if (text[linevis++] == TEXTCOLOR_ESCAPE)
|
||||||
|
{
|
||||||
|
if (text[linevis] == '[')
|
||||||
|
{ // named color
|
||||||
|
while (text[linevis] != ']' && text[linevis] != '\0')
|
||||||
|
{
|
||||||
|
linevis++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linevis += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LineVisible = linevis;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue