mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 12:05:39 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool loadedTexture {false};
|
||||||
|
|
||||||
|
if (mCarousel != nullptr && mCarousel->isScrolling()) {
|
||||||
|
mCarousel->onDemandTextureLoad();
|
||||||
|
loadedTexture = true;
|
||||||
|
}
|
||||||
|
|
||||||
FileData* file {(mPrimary->size() > 0 && state == CursorState::CURSOR_STOPPED) ?
|
FileData* file {(mPrimary->size() > 0 && state == CursorState::CURSOR_STOPPED) ?
|
||||||
mPrimary->getSelected() :
|
mPrimary->getSelected() :
|
||||||
nullptr};
|
nullptr};
|
||||||
|
|
||||||
if (mCarousel != nullptr)
|
|
||||||
mCarousel->onDemandTextureLoad();
|
|
||||||
|
|
||||||
// If the game data has already been rendered to the view, then skip it this time.
|
// If the game data has already been rendered to the view, then skip it this time.
|
||||||
// This also happens when fast-scrolling.
|
// This also happens when fast-scrolling.
|
||||||
if (file == mLastUpdated)
|
if (file == mLastUpdated)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (mCarousel != nullptr && !loadedTexture)
|
||||||
|
mCarousel->onDemandTextureLoad();
|
||||||
|
|
||||||
if (state == CursorState::CURSOR_STOPPED)
|
if (state == CursorState::CURSOR_STOPPED)
|
||||||
mLastUpdated = file;
|
mLastUpdated = file;
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
void setItemType(std::string itemType) { mItemType = itemType; }
|
void setItemType(std::string itemType) { mItemType = itemType; }
|
||||||
const std::string& getDefaultItem() { return mDefaultItem; }
|
const std::string& getDefaultItem() { return mDefaultItem; }
|
||||||
void setDefaultItem(std::string defaultItem) { mDefaultItem = defaultItem; }
|
void setDefaultItem(std::string defaultItem) { mDefaultItem = defaultItem; }
|
||||||
|
bool isScrolling() const override { return List::isScrolling(); }
|
||||||
|
|
||||||
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
|
void setCursorChangedCallback(const std::function<void(CursorState state)>& func) override
|
||||||
{
|
{
|
||||||
|
@ -83,7 +84,6 @@ private:
|
||||||
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
|
NavigationSounds::getInstance().playThemeNavigationSound(SYSTEMBROWSESOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isScrolling() const override { return List::isScrolling(); }
|
|
||||||
void stopScrolling() override
|
void stopScrolling() override
|
||||||
{
|
{
|
||||||
List::stopScrolling();
|
List::stopScrolling();
|
||||||
|
|
Loading…
Reference in a new issue