mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Eliminated some unnecessary carousel on-demand texture loading.
This commit is contained in:
parent
04473d0ff3
commit
f620df4dff
|
@ -433,18 +433,25 @@ void GamelistView::updateView(const CursorState& state)
|
|||
return;
|
||||
}
|
||||
|
||||
bool loadedTexture {false};
|
||||
|
||||
if (mCarousel != nullptr && mCarousel->isScrolling()) {
|
||||
mCarousel->onDemandTextureLoad();
|
||||
loadedTexture = true;
|
||||
}
|
||||
|
||||
FileData* file {(mPrimary->size() > 0 && state == CursorState::CURSOR_STOPPED) ?
|
||||
mPrimary->getSelected() :
|
||||
nullptr};
|
||||
|
||||
if (mCarousel != nullptr)
|
||||
mCarousel->onDemandTextureLoad();
|
||||
|
||||
// If the game data has already been rendered to the view, then skip it this time.
|
||||
// This also happens when fast-scrolling.
|
||||
if (file == mLastUpdated)
|
||||
return;
|
||||
|
||||
if (mCarousel != nullptr && !loadedTexture)
|
||||
mCarousel->onDemandTextureLoad();
|
||||
|
||||
if (state == CursorState::CURSOR_STOPPED)
|
||||
mLastUpdated = file;
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
void setItemType(std::string itemType) { mItemType = itemType; }
|
||||
const std::string& getDefaultItem() { return mDefaultItem; }
|
||||
void setDefaultItem(std::string defaultItem) { mDefaultItem = defaultItem; }
|
||||
bool isScrolling() const override { return List::isScrolling(); }
|
||||
|
||||
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
|
||||
{
|
||||
|
@ -83,7 +84,6 @@ private:
|
|||
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
|
||||
}
|
||||
|
||||
bool isScrolling() const override { return List::isScrolling(); }
|
||||
void stopScrolling() override
|
||||
{
|
||||
List::stopScrolling();
|
||||
|
|
Loading…
Reference in a new issue