mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Set forceloading of all images for the startup system to avoid texture pop-in.
This commit is contained in:
parent
c50f39dd05
commit
d2641d5c2c
|
@ -104,6 +104,9 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool isStartupSystem {Settings::getInstance()->getString("StartupSystem") ==
|
||||||
|
mRoot->getSystem()->getName()};
|
||||||
|
|
||||||
using namespace ThemeFlags;
|
using namespace ThemeFlags;
|
||||||
|
|
||||||
if (mTheme->hasView("gamelist")) {
|
if (mTheme->hasView("gamelist")) {
|
||||||
|
@ -169,6 +172,10 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
||||||
addChild(mPrimary);
|
addChild(mPrimary);
|
||||||
}
|
}
|
||||||
if (element.second.type == "image") {
|
if (element.second.type == "image") {
|
||||||
|
// If this is the startup system, then forceload the images to avoid texture pop-in.
|
||||||
|
if (isStartupSystem)
|
||||||
|
mImageComponents.push_back(std::make_unique<ImageComponent>(true));
|
||||||
|
else
|
||||||
mImageComponents.push_back(std::make_unique<ImageComponent>());
|
mImageComponents.push_back(std::make_unique<ImageComponent>());
|
||||||
mImageComponents.back()->setDefaultZIndex(30.0f);
|
mImageComponents.back()->setDefaultZIndex(30.0f);
|
||||||
mImageComponents.back()->applyTheme(theme, "gamelist", element.first, ALL);
|
mImageComponents.back()->applyTheme(theme, "gamelist", element.first, ALL);
|
||||||
|
|
|
@ -472,7 +472,15 @@ void SystemView::populate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (element.second.type == "image") {
|
else if (element.second.type == "image") {
|
||||||
elements.imageComponents.emplace_back(std::make_unique<ImageComponent>());
|
// If this is the first system, then forceload the images to avoid texture
|
||||||
|
// pop-in.
|
||||||
|
if (it == SystemData::sSystemVector.front())
|
||||||
|
elements.imageComponents.emplace_back(
|
||||||
|
std::make_unique<ImageComponent>(true));
|
||||||
|
else
|
||||||
|
elements.imageComponents.emplace_back(
|
||||||
|
std::make_unique<ImageComponent>());
|
||||||
|
|
||||||
elements.imageComponents.back()->setDefaultZIndex(30.0f);
|
elements.imageComponents.back()->setDefaultZIndex(30.0f);
|
||||||
elements.imageComponents.back()->applyTheme(theme, "system", element.first,
|
elements.imageComponents.back()->applyTheme(theme, "system", element.first,
|
||||||
ThemeFlags::ALL);
|
ThemeFlags::ALL);
|
||||||
|
|
Loading…
Reference in a new issue