activated enhanced "full" redraw logic

This commit is contained in:
thrust26 2020-11-11 15:37:32 +01:00
parent 7d63a0dfb8
commit 9f88a116a4
2 changed files with 24 additions and 37 deletions

View File

@ -323,13 +323,14 @@ void FrameBuffer::update(bool force)
// last, since they are always drawn on top of everything else).
// Full rendering is required when messages are enabled
force = force || myMsg.counter >= 0;
force |= (myMsg.counter >= 0);
// Detect when a message has been turned off; one last redraw is required
// in this case, to draw over the area that the message occupied
if(myMsg.counter == 0)
myMsg.counter = -1;
bool redraw = false;
switch(myOSystem.eventHandler().state())
{
case EventHandlerState::NONE:
@ -354,8 +355,8 @@ void FrameBuffer::update(bool force)
#ifdef GUI_SUPPORT
case EventHandlerState::OPTIONSMENU:
{
force = force || myOSystem.menu().needsRedraw();
if(force)
redraw = myOSystem.menu().needsRedraw();
if(force || redraw)
{
clear();
myTIASurface->render();
@ -366,8 +367,8 @@ void FrameBuffer::update(bool force)
case EventHandlerState::CMDMENU:
{
force = force || myOSystem.commandMenu().needsRedraw();
if(force)
redraw = myOSystem.commandMenu().needsRedraw();
if(force || redraw)
{
clear();
myTIASurface->render();
@ -378,8 +379,8 @@ void FrameBuffer::update(bool force)
case EventHandlerState::MESSAGEMENU:
{
force = force || myOSystem.messageMenu().needsRedraw();
if (force)
redraw = myOSystem.messageMenu().needsRedraw();
if(force || redraw)
{
clear();
myTIASurface->render();
@ -390,8 +391,8 @@ void FrameBuffer::update(bool force)
case EventHandlerState::TIMEMACHINE:
{
force = force || myOSystem.timeMachine().needsRedraw();
if(force)
redraw = myOSystem.timeMachine().needsRedraw();
if(force || redraw)
{
clear();
myTIASurface->render();
@ -436,10 +437,9 @@ void FrameBuffer::update(bool force)
case EventHandlerState::LAUNCHER:
{
force = force || myOSystem.launcher().needsRedraw();
if(force)
redraw = myOSystem.launcher().needsRedraw();
if(force || redraw)
{
//clear();
myOSystem.launcher().draw(force);
}
break; // EventHandlerState::LAUNCHER
@ -449,10 +449,10 @@ void FrameBuffer::update(bool force)
#ifdef DEBUGGER_SUPPORT
case EventHandlerState::DEBUGGER:
{
force = force || myOSystem.debugger().needsRedraw();
if(force)
redraw = myOSystem.debugger().needsRedraw();
if(force || redraw)
{
clear();
myOSystem.debugger().draw(force);
}
break; // EventHandlerState::DEBUGGER
@ -471,7 +471,7 @@ void FrameBuffer::update(bool force)
drawMessage();
// Push buffers to screen only when necessary
if(force)
if(force || redraw)
myBackend->renderToScreen();
}

View File

@ -91,32 +91,19 @@ void DialogContainer::updateTime(uInt64 time)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool DialogContainer::draw(bool full)
{
//cerr << "draw " << full << endl;
cerr << "draw " << full << " " << typeid(*this).name() << endl;
if(myDialogStack.empty())
return false;
// Make the top dialog dirty if a full redraw is requested
//if(full)
// myDialogStack.top()->setDirty();
if(full)
myDialogStack.top()->setDirty();
// If the top dialog is dirty, then all below it must be redrawn too
const bool dirty = needsRedraw();
//if(dirty)
// myDialogStack.top()->setDirty();
//myDialogStack.applyAll([&](Dialog*& d){
// if(dirty)
// d->setDirty();
// full |= d->render();
//});
//if(dirty)
{
// Render all dirty dialogs
myDialogStack.applyAll([&](Dialog*& d) {
if(d->needsRedraw())
//d->setDirty();
full |= d->render();
});
}
return full;
}