From cba2e347c4ec80099d54e7dd2daed1fc9003a1ca Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Sun, 16 Aug 2020 13:28:25 -0700 Subject: [PATCH 1/8] Update VideoComponent.cpp Fix the size issue for images when reentering EmulationStation after having launched a game --- es-core/src/components/VideoComponent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index af3f4d168d..9ec84a6d10 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -131,6 +131,7 @@ void VideoComponent::setImage(std::string path) return; mStaticImage.setImage(path); + mStaticImage.resize(); mFadeIn = 0.0f; mStaticImagePath = path; } From 01809b917eea4b94cf4ac10f3a9f21bb83048d90 Mon Sep 17 00:00:00 2001 From: Cedrick Collomb Date: Sun, 16 Aug 2020 14:55:41 -0700 Subject: [PATCH 2/8] Revert "Update VideoComponent.cpp" This reverts commit cba2e347c4ec80099d54e7dd2daed1fc9003a1ca. --- es-core/src/components/VideoComponent.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index 9ec84a6d10..af3f4d168d 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -131,7 +131,6 @@ void VideoComponent::setImage(std::string path) return; mStaticImage.setImage(path); - mStaticImage.resize(); mFadeIn = 0.0f; mStaticImagePath = path; } From c9c9c38dc46bc99de6031d78728abdbe1a0d41ce Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:07:48 -0700 Subject: [PATCH 3/8] Update Renderer.h --- es-core/src/renderers/Renderer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/es-core/src/renderers/Renderer.h b/es-core/src/renderers/Renderer.h index 3b41e338d4..55e105e0db 100644 --- a/es-core/src/renderers/Renderer.h +++ b/es-core/src/renderers/Renderer.h @@ -87,6 +87,7 @@ namespace Renderer void destroyTexture (const unsigned int _texture); void updateTexture (const unsigned int _texture, const Texture::Type _type, const unsigned int _x, const unsigned _y, const unsigned int _width, const unsigned int _height, void* _data); void bindTexture (const unsigned int _texture); + void setMagFilter (const bool _linearMag); void drawLines (const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor = Blend::SRC_ALPHA, const Blend::Factor _dstBlendFactor = Blend::ONE_MINUS_SRC_ALPHA); void drawTriangleStrips(const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor = Blend::SRC_ALPHA, const Blend::Factor _dstBlendFactor = Blend::ONE_MINUS_SRC_ALPHA); void setProjection (const Transform4x4f& _projection); From 9e77f26602ac022fef4a88915928d51cd6044123 Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:09:08 -0700 Subject: [PATCH 4/8] Update Renderer_GL14.cpp --- es-core/src/renderers/Renderer_GL14.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es-core/src/renderers/Renderer_GL14.cpp b/es-core/src/renderers/Renderer_GL14.cpp index 23662914c2..5cc6330fde 100644 --- a/es-core/src/renderers/Renderer_GL14.cpp +++ b/es-core/src/renderers/Renderer_GL14.cpp @@ -172,6 +172,11 @@ namespace Renderer } // bindTexture + void setMagFilterTexture(const bool _linearMag) + { + GL_CHECK_ERROR(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _linearMag ? GL_LINEAR : GL_NEAREST)); + } // change mag filter for currently bound texture + void drawLines(const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor, const Blend::Factor _dstBlendFactor) { GL_CHECK_ERROR(glVertexPointer( 2, GL_FLOAT, sizeof(Vertex), &_vertices[0].pos)); From 010d3d6ca34e812236dc4746d67be09d23c2576d Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:10:06 -0700 Subject: [PATCH 5/8] Update VideoComponent.h --- es-core/src/components/VideoComponent.h | 1 + 1 file changed, 1 insertion(+) diff --git a/es-core/src/components/VideoComponent.h b/es-core/src/components/VideoComponent.h index 8513129f95..7ca9bc8935 100644 --- a/es-core/src/components/VideoComponent.h +++ b/es-core/src/components/VideoComponent.h @@ -21,6 +21,7 @@ class VideoComponent : public GuiComponent bool showSnapshotNoVideo; bool showSnapshotDelay; std::string defaultVideoPath; + bool magFilterLinear; }; public: From 754c547def804fc03939149b70c0047742b7342a Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:11:18 -0700 Subject: [PATCH 6/8] Update VideoComponent.cpp --- es-core/src/components/VideoComponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index af3f4d168d..c64ecbb1f3 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -67,7 +67,8 @@ VideoComponent::VideoComponent(Window* window) : // Setup the default configuration mConfig.showSnapshotDelay = false; mConfig.showSnapshotNoVideo = false; - mConfig.startDelay = 0; + mConfig.startDelay = 0; + mConfig.magFilterLinear = false; if (mWindow->getGuiStackSize() > 1) { topWindow(false); } @@ -207,6 +208,9 @@ void VideoComponent::applyTheme(const std::shared_ptr& theme, const s if (elem->has("showSnapshotDelay")) mConfig.showSnapshotDelay = elem->get("showSnapshotDelay"); + + if (elem->has("magFilterLinear")) + mConfig.magFilterLinear = elem->get("magFilterLinear"); } std::vector VideoComponent::getHelpPrompts() From 4679d86c45c99f27aa9cb994e66a567591eeb481 Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:13:01 -0700 Subject: [PATCH 7/8] Update VideoVlcComponent.cpp --- es-core/src/components/VideoVlcComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/VideoVlcComponent.cpp b/es-core/src/components/VideoVlcComponent.cpp index 704c08acae..5cbfb17570 100644 --- a/es-core/src/components/VideoVlcComponent.cpp +++ b/es-core/src/components/VideoVlcComponent.cpp @@ -157,7 +157,8 @@ void VideoVlcComponent::render(const Transform4x4f& parentTrans) // Build a texture for the video frame mTexture->initFromPixels((unsigned char*)mContext.surface->pixels, mContext.surface->w, mContext.surface->h); mTexture->bind(); - + Renderer::setMagFilter(mConfig.magFilterLinear); + // Render it Renderer::drawTriangleStrips(&vertices[0], 4); } From 39f44f76c96320a2fee03956df0e04a016763f4c Mon Sep 17 00:00:00 2001 From: ccollomb <34297323+ccollomb@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:15:48 -0700 Subject: [PATCH 8/8] Update Renderer_GL14.cpp --- es-core/src/renderers/Renderer_GL14.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-core/src/renderers/Renderer_GL14.cpp b/es-core/src/renderers/Renderer_GL14.cpp index 5cc6330fde..991c48ce68 100644 --- a/es-core/src/renderers/Renderer_GL14.cpp +++ b/es-core/src/renderers/Renderer_GL14.cpp @@ -172,7 +172,7 @@ namespace Renderer } // bindTexture - void setMagFilterTexture(const bool _linearMag) + void setMagFilter(const bool _linearMag) { GL_CHECK_ERROR(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _linearMag ? GL_LINEAR : GL_NEAREST)); } // change mag filter for currently bound texture