Added mOpacity video fading support to VideoFFmpegComponent

This commit is contained in:
Leon Styhre 2022-08-18 22:38:09 +02:00
parent 58803fe8f7
commit 389dc6ed79

View file

@ -125,7 +125,7 @@ void VideoFFmpegComponent::resize()
void VideoFFmpegComponent::render(const glm::mat4& parentTrans) void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
{ {
if (!mVisible || mThemeOpacity == 0.0f) if (!mVisible || mOpacity == 0.0f || mThemeOpacity == 0.0f)
return; return;
if (!mHasVideo && mStaticImagePath == "") if (!mHasVideo && mStaticImagePath == "")
@ -141,7 +141,7 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
unsigned int rectColor {0x000000FF}; unsigned int rectColor {0x000000FF};
if (mThemeOpacity != 1.0f) if (mThemeOpacity != 1.0f)
rectColor = static_cast<int>(mThemeOpacity * mFadeIn * 255.0f); rectColor = static_cast<int>(mFadeIn * mOpacity * mThemeOpacity * 255.0f);
// Render the black rectangle behind the video. // Render the black rectangle behind the video.
if (mVideoRectangleCoords.size() == 4) { if (mVideoRectangleCoords.size() == 4) {
@ -214,7 +214,7 @@ void VideoFFmpegComponent::render(const glm::mat4& parentTrans)
// or the video screensaver, then skip this as the scanline rendering is then handled // or the video screensaver, then skip this as the scanline rendering is then handled
// in those modules as a post-processing step. // in those modules as a post-processing step.
if (!mScreensaverMode && !mMediaViewerMode) { if (!mScreensaverMode && !mMediaViewerMode) {
vertices[0].opacity = mFadeIn * mThemeOpacity; vertices[0].opacity = mFadeIn * mOpacity * mThemeOpacity;
if ((mLegacyTheme && Settings::getInstance()->getBool("GamelistVideoScanlines")) || if ((mLegacyTheme && Settings::getInstance()->getBool("GamelistVideoScanlines")) ||
(!mLegacyTheme && mRenderScanlines)) { (!mLegacyTheme && mRenderScanlines)) {
vertices[0].shaders = Renderer::Shader::SCANLINES; vertices[0].shaders = Renderer::Shader::SCANLINES;