1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

better approach for redrawing

This commit is contained in:
Laserlicht 2023-09-26 21:12:04 +02:00 committed by GitHub
parent e69b91fbdd
commit 2738dc3190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,8 @@ CMenuScreen::CMenuScreen(const JsonNode & configNode)
menuNameToEntry.push_back("credits");
tabs = std::make_shared<CTabbedInt>(std::bind(&CMenuScreen::createTab, this, _1));
tabs->setRedrawParent(true);
if(config["video"].isNull())
tabs->setRedrawParent(true);
}
std::shared_ptr<CIntObject> CMenuScreen::createTab(size_t index)
@ -109,10 +110,10 @@ void CMenuScreen::show(Canvas & to)
{
if(!config["video"].isNull())
{
// redraw order: background -> video -> buttons and pictures
background->redraw();
CCS->videoh->update((int)config["video"]["x"].Float() + pos.x, (int)config["video"]["y"].Float() + pos.y, to.getInternalSurface(), true, false);
tabs->setRedrawParent(false);
tabs->redraw();
tabs->setRedrawParent(true);
}
CIntObject::show(to);
}