mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2023-12-30 21:52:56 +00:00
TTextBox: fixed DrawText texts getting overwritten by full redraw.
This bug is from the original 3DPB.
This commit is contained in:
parent
c0ec8ec932
commit
1c1fbcb811
@ -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;
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -377,7 +377,7 @@ void fullscrn::paint()
|
||||
fillRect(WindowRect1.right, menuHeight + WindowRect1.bottom, 0, 0);
|
||||
}
|
||||
}
|
||||
render::paint();
|
||||
pb::paint();
|
||||
fullscrn_flag1 = 0;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user