mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Added support for fade-in and fade-out of static videos.
This commit is contained in:
parent
6fd47a5599
commit
720a6fcc22
|
@ -194,6 +194,7 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
|||
ALL);
|
||||
if (mStaticVideoComponents.back()->getMetadataElement())
|
||||
mStaticVideoComponents.back()->setScrollHide(true);
|
||||
mStaticVideoComponents.back()->setGeneralFade(true);
|
||||
}
|
||||
else {
|
||||
mVideoComponents.push_back(std::make_unique<VideoFFmpegComponent>());
|
||||
|
|
|
@ -37,6 +37,7 @@ VideoComponent::VideoComponent()
|
|||
, mRenderScanlines {false}
|
||||
, mLegacyTheme {false}
|
||||
, mHasVideo {false}
|
||||
, mGeneralFade {false}
|
||||
, mFadeIn {1.0f}
|
||||
, mFadeInTime {1000.0f}
|
||||
{
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
void setOpacity(float opacity) override { mOpacity = opacity; }
|
||||
// Set whether to draw black pillarboxes/letterboxes behind videos.
|
||||
void setDrawPillarboxes(bool state) { mDrawPillarboxes = state; }
|
||||
// Whether to fade out the entire video surface including the black rectangle.
|
||||
void setGeneralFade(bool state) { mGeneralFade = state; }
|
||||
|
||||
bool hasStaticVideo() { return !mConfig.staticVideoPath.empty(); }
|
||||
bool hasStaticImage() { return mStaticImage.getTextureSize() != glm::ivec2 {0, 0}; }
|
||||
|
@ -129,6 +131,7 @@ protected:
|
|||
bool mRenderScanlines;
|
||||
bool mLegacyTheme;
|
||||
bool mHasVideo;
|
||||
bool mGeneralFade;
|
||||
float mFadeIn;
|
||||
float mFadeInTime;
|
||||
|
||||
|
|
|
@ -140,7 +140,9 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
|
|||
|
||||
unsigned int rectColor {0x000000FF};
|
||||
|
||||
if (mThemeOpacity != 1.0f)
|
||||
if (!mGeneralFade && mThemeOpacity != 1.0f)
|
||||
rectColor = static_cast<int>(mThemeOpacity * 255.0f);
|
||||
if (mGeneralFade && (mOpacity != 1.0f || mThemeOpacity != 1.0f))
|
||||
rectColor = static_cast<int>(mFadeIn * mOpacity * mThemeOpacity * 255.0f);
|
||||
|
||||
// Render the black rectangle behind the video.
|
||||
|
|
Loading…
Reference in a new issue