fixed forced full redraws

force full UI redraw when UI palette changes
This commit is contained in:
thrust26 2020-11-13 09:36:57 +01:00
parent bc7ac83c49
commit 15576fe6b1
4 changed files with 11 additions and 6 deletions

View File

@ -889,6 +889,8 @@ void FrameBuffer::setUIPalette()
myFullPalette[j] = mapRGB(r, g, b);
}
FBSurface::setPalette(myFullPalette);
if(&myOSystem.eventHandler())
update(true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -217,10 +217,13 @@ void Dialog::positionAt(uInt32 pos)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::redraw()
void Dialog::redraw(bool force)
{
if(!isVisible() || !needsRedraw())
return;// false;
if(!isVisible())
return;
if(force)
setDirty();
// Draw this dialog
setPosition();

View File

@ -64,7 +64,7 @@ class Dialog : public GuiObject
void tick() override;
bool isChainDirty() const override;
void redraw();
void redraw(bool force = false);
void render();
void addFocusWidget(Widget* w) override;

View File

@ -102,8 +102,8 @@ void DialogContainer::draw(bool full)
// Draw and render all dirty dialogs
myDialogStack.applyAll([&](Dialog*& d) {
if(d->needsRedraw())
d->redraw();
if(full || d->needsRedraw())
d->redraw(full);
});
// Always render all surfaces, bottom to top
render();