1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-14 05:48:04 +01:00

TTextBox: fixed DrawText texts getting overwritten by full redraw.

This bug is from the original 3DPB.
This commit is contained in:
Muzychenko Andrey 2021-10-30 18:25:49 +03:00
parent c0ec8ec932
commit 1c1fbcb811
4 changed files with 17 additions and 3 deletions

View file

@ -153,7 +153,7 @@ void TTextBox::Display(const wchar_t* text, float time)
}
}
void TTextBox::Draw()
void TTextBox::Draw(bool redraw)
{
auto bmp = BgBmp;
if (bmp)
@ -172,6 +172,12 @@ void TTextBox::Draw()
bool display = false;
while (Message1)
{
if (redraw)
{
display = true;
break;
}
if (Message1->Time == -1.0f)
{
if (!Message1->NextMessage)
@ -183,6 +189,8 @@ void TTextBox::Draw()
}
else if (Message1->TimeLeft() >= -2.0f)
{
if (Timer > 0)
timer::kill(Timer);
Timer = timer::set(max(Message1->TimeLeft(), 0.25f), this, TimerExpired);
display = true;
break;

View file

@ -22,7 +22,7 @@ public:
int Message(int code, float value) override;
void Clear();
void Display(const wchar_t* text, float time);
void Draw();
void Draw(bool redraw = false);
static void TimerExpired(int timerId, void* tb);
};

View file

@ -377,7 +377,7 @@ void fullscrn::paint()
fillRect(WindowRect1.right, menuHeight + WindowRect1.bottom, 0, 0);
}
}
render::paint();
pb::paint();
fullscrn_flag1 = 0;
}

View file

@ -135,6 +135,12 @@ void pb::firsttime_setup()
void pb::paint()
{
render::paint();
if (score::msg_fontp == nullptr)
{
// DrawText writes to screen directly, text gets overwritten by full vScreen blit.
pinball::InfoTextBox->Draw(true);
pinball::MissTextBox->Draw(true);
}
}
void pb::mode_change(int mode)