mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 21:55:38 +00:00
Eliminated unnecessary processing and rendering in the gamelist view.
Also added a game image fade-in effect to the Detailed view style.
This commit is contained in:
parent
db0e15f5e8
commit
98d38b3b46
1
NEWS.md
1
NEWS.md
|
@ -80,6 +80,7 @@ Many bugs have been fixed, and numerous features that were only partially implem
|
||||||
* Deleting a game from the metadata editor did not delete the game media files or the entry in the gamelist.xml file
|
* Deleting a game from the metadata editor did not delete the game media files or the entry in the gamelist.xml file
|
||||||
* SystemView didn't properly loop the systems if only two systems were available
|
* SystemView didn't properly loop the systems if only two systems were available
|
||||||
* Hidden files still showed up if they had a gamelist.xml entry
|
* Hidden files still showed up if they had a gamelist.xml entry
|
||||||
|
* Fixed an annoying gamelist issue that caused the game images and data to be updated and rendered up to six times every time the list was scrolled
|
||||||
* VRAM statistics overlay was somewhat broken and incorrectly displayed numbers in megabytes instead of mebibytes
|
* VRAM statistics overlay was somewhat broken and incorrectly displayed numbers in megabytes instead of mebibytes
|
||||||
* On Unix, adding a hidden folder with a game in it crashed the application on startup
|
* On Unix, adding a hidden folder with a game in it crashed the application on startup
|
||||||
* If the user tried to enter a blank game name in the metadata editor, the application would crash upon saving
|
* If the user tried to enter a blank game name in the metadata editor, the application would crash upon saving
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
#include "animations/LambdaAnimation.h"
|
#include "animations/LambdaAnimation.h"
|
||||||
#include "views/ViewController.h"
|
#include "views/ViewController.h"
|
||||||
|
|
||||||
|
#define FADE_IN_START_OPACITY 0.5f
|
||||||
|
#define FADE_IN_TIME 300
|
||||||
|
|
||||||
DetailedGameListView::DetailedGameListView(
|
DetailedGameListView::DetailedGameListView(
|
||||||
Window* window,
|
Window* window,
|
||||||
FileData* root)
|
FileData* root)
|
||||||
|
@ -37,7 +40,8 @@ DetailedGameListView::DetailedGameListView(
|
||||||
mPlayers(window),
|
mPlayers(window),
|
||||||
mLastPlayed(window),
|
mLastPlayed(window),
|
||||||
mPlayCount(window),
|
mPlayCount(window),
|
||||||
mName(window)
|
mName(window),
|
||||||
|
mLastUpdated(nullptr)
|
||||||
{
|
{
|
||||||
const float padding = 0.01f;
|
const float padding = 0.01f;
|
||||||
|
|
||||||
|
@ -233,6 +237,13 @@ void DetailedGameListView::initMDValues()
|
||||||
void DetailedGameListView::updateInfoPanel()
|
void DetailedGameListView::updateInfoPanel()
|
||||||
{
|
{
|
||||||
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
|
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
|
||||||
|
|
||||||
|
// If the game data has already been rendered to the info panel, then skip it this time.
|
||||||
|
if (file == mLastUpdated) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLastUpdated = file;
|
||||||
|
|
||||||
bool hideMetaDataFields = false;
|
bool hideMetaDataFields = false;
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
|
@ -277,14 +288,20 @@ void DetailedGameListView::updateInfoPanel()
|
||||||
|
|
||||||
bool fadingOut;
|
bool fadingOut;
|
||||||
if (file == nullptr) {
|
if (file == nullptr) {
|
||||||
//mImage.setImage("");
|
|
||||||
//mDescription.setText("");
|
|
||||||
fadingOut = true;
|
fadingOut = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mThumbnail.setImage(file->getThumbnailPath());
|
mThumbnail.setImage(file->getThumbnailPath());
|
||||||
mMarquee.setImage(file->getMarqueePath());
|
mMarquee.setImage(file->getMarqueePath());
|
||||||
mImage.setImage(file->getImagePath());
|
mImage.setImage(file->getImagePath());
|
||||||
|
|
||||||
|
// Fade in the game image.
|
||||||
|
auto func = [this](float t) {
|
||||||
|
mImage.setOpacity((unsigned char)(Math::lerp(
|
||||||
|
static_cast<float>(FADE_IN_START_OPACITY), 1.0f, t)*255));
|
||||||
|
};
|
||||||
|
mImage.setAnimation(new LambdaAnimation(func, FADE_IN_TIME), 0, nullptr, false);
|
||||||
|
|
||||||
mDescription.setText(file->metadata.get("desc"));
|
mDescription.setText(file->metadata.get("desc"));
|
||||||
mDescContainer.reset();
|
mDescContainer.reset();
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
// Interface that defines a GameListView of the type 'detailed'.
|
// Interface that defines a GameListView of the type 'detailed'.
|
||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#ifndef ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
#ifndef ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
||||||
#define ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
#define ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
||||||
|
|
||||||
|
@ -58,6 +57,8 @@ private:
|
||||||
|
|
||||||
ScrollableContainer mDescContainer;
|
ScrollableContainer mDescContainer;
|
||||||
TextComponent mDescription;
|
TextComponent mDescription;
|
||||||
|
|
||||||
|
FileData* mLastUpdated;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
#endif // ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
|
||||||
|
|
|
@ -81,15 +81,6 @@ VideoGameListView::VideoGameListView(
|
||||||
mMarquee.setDefaultZIndex(35);
|
mMarquee.setDefaultZIndex(35);
|
||||||
addChild(&mMarquee);
|
addChild(&mMarquee);
|
||||||
|
|
||||||
// Image.
|
|
||||||
mImage.setOrigin(0.5f, 0.5f);
|
|
||||||
// Default to off the screen.
|
|
||||||
mImage.setPosition(mSize.x() * 0.25f, mList.getPosition().y() + mSize.y() * 0.2125f);
|
|
||||||
mImage.setVisible(false);
|
|
||||||
mImage.setMaxSize(mSize.x() * (0.50f - 2*padding), mSize.y() * 0.4f);
|
|
||||||
mImage.setDefaultZIndex(30);
|
|
||||||
addChild(&mImage);
|
|
||||||
|
|
||||||
// Video.
|
// Video.
|
||||||
mVideo->setOrigin(0.5f, 0.5f);
|
mVideo->setOrigin(0.5f, 0.5f);
|
||||||
mVideo->setPosition(mSize.x() * 0.25f, mSize.y() * 0.4f);
|
mVideo->setPosition(mSize.x() * 0.25f, mSize.y() * 0.4f);
|
||||||
|
@ -265,10 +256,16 @@ void VideoGameListView::initMDValues()
|
||||||
void VideoGameListView::updateInfoPanel()
|
void VideoGameListView::updateInfoPanel()
|
||||||
{
|
{
|
||||||
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
|
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
|
||||||
bool hideMetaDataFields = false;
|
|
||||||
|
|
||||||
Utils::FileSystem::removeFile(getTitlePath());
|
Utils::FileSystem::removeFile(getTitlePath());
|
||||||
|
|
||||||
|
// If the game data has already been rendered to the info panel, then skip it this time.
|
||||||
|
if (file == mLastUpdated) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLastUpdated = file;
|
||||||
|
|
||||||
|
bool hideMetaDataFields = false;
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
hideMetaDataFields = (file->metadata.get("hidemetadata") == "true");
|
hideMetaDataFields = (file->metadata.get("hidemetadata") == "true");
|
||||||
|
|
||||||
|
@ -314,8 +311,6 @@ void VideoGameListView::updateInfoPanel()
|
||||||
mVideo->setVideo("");
|
mVideo->setVideo("");
|
||||||
mVideo->setImage("");
|
mVideo->setImage("");
|
||||||
mVideoPlaying = false;
|
mVideoPlaying = false;
|
||||||
//mMarquee.setImage("");
|
|
||||||
//mDescription.setText("");
|
|
||||||
fadingOut = true;
|
fadingOut = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
// Interface that defines a GameListView of the type 'video'.
|
// Interface that defines a GameListView of the type 'video'.
|
||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#ifndef ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
#ifndef ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
||||||
#define ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
#define ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
||||||
|
|
||||||
|
@ -22,9 +21,7 @@ public:
|
||||||
virtual ~VideoGameListView();
|
virtual ~VideoGameListView();
|
||||||
|
|
||||||
virtual void onShow() override;
|
virtual void onShow() override;
|
||||||
|
|
||||||
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
||||||
|
|
||||||
virtual const char* getName() const override { return "video"; }
|
virtual const char* getName() const override { return "video"; }
|
||||||
virtual void launch(FileData* game) override;
|
virtual void launch(FileData* game) override;
|
||||||
|
|
||||||
|
@ -68,6 +65,7 @@ private:
|
||||||
TextComponent mDescription;
|
TextComponent mDescription;
|
||||||
|
|
||||||
bool mVideoPlaying;
|
bool mVideoPlaying;
|
||||||
|
FileData* mLastUpdated;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
#endif // ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
|
||||||
|
|
Loading…
Reference in a new issue