From 90246dd4c124663ae391cc71a7f2140b58525584 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 28 Mar 2020 03:46:31 -0400 Subject: [PATCH] fix raw screenshots, which previously were a mixed up mess of user filters and sysdrawing downscaling. fixes #1902. This was broken by 95bc69b4487fe6787606cbe459151ba339e8bd36 (or else it was benign at that time and broken later, but the fundamental change was here). This caused the raw screenshots to go through the displaymanager instead of very simply converting the core's videoprovider at that point. The reason was because only the displaymanager had the power to render an opengl core's texture ID. In this commit, I fixed it so that displaymanager had the power to render a videoprovider WITHOUT the user's scaling filters --- .../DisplayManager/DisplayManager.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index cac10512d7..0fabc34937 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -222,7 +222,7 @@ namespace BizHawk.Client.EmuHawk return padding; } - FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, bool includeOSD) + FilterProgram BuildDefaultChain(Size chainInSize, Size chainOutSize, bool includeOSD, bool includeUserFilters) { // select user special FX shader chain var selectedChainProperties = new Dictionary(); @@ -232,6 +232,8 @@ namespace BizHawk.Client.EmuHawk selectedChain = ShaderChain_hq2x; } + //ZOOM + if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available) { selectedChain = ShaderChain_scanlines; @@ -243,6 +245,9 @@ namespace BizHawk.Client.EmuHawk selectedChain = ShaderChain_user; } + if (!includeUserFilters) + selectedChain = null; + var fPresent = new Filters.FinalPresentation(chainOutSize); var fInput = new Filters.SourceImage(chainInSize); var fOSD = new Filters.OSD(); @@ -437,7 +442,8 @@ namespace BizHawk.Client.EmuHawk VideoProvider = videoProvider, Simulate = displayNothing, ChainOutsize = GraphicsControl.Size, - IncludeOSD = true + IncludeOSD = true, + IncludeUserFilters = true }; UpdateSourceInternal(job); } @@ -456,7 +462,8 @@ namespace BizHawk.Client.EmuHawk Simulate = false, ChainOutsize = targetSize, Offscreen = true, - IncludeOSD = false + IncludeOSD = false, + IncludeUserFilters = false }; UpdateSourceInternal(job); return job.OffscreenBb; @@ -473,7 +480,8 @@ namespace BizHawk.Client.EmuHawk Simulate = false, ChainOutsize = GraphicsControl.Size, Offscreen = true, - IncludeOSD = includeOSD + IncludeOSD = includeOSD, + IncludeUserFilters = true, }; UpdateSourceInternal(job); return job.OffscreenBb; @@ -657,7 +665,8 @@ namespace BizHawk.Client.EmuHawk { VideoProvider = fvp, Simulate = true, - ChainOutsize = chainOutsize + ChainOutsize = chainOutsize, + IncludeUserFilters = true }; var filterProgram = UpdateSourceInternal(job); @@ -681,6 +690,7 @@ namespace BizHawk.Client.EmuHawk public bool Offscreen; public BitmapBuffer OffscreenBb; public bool IncludeOSD; + public bool IncludeUserFilters; } private FilterProgram UpdateSourceInternal(JobInfo job) @@ -770,7 +780,7 @@ namespace BizHawk.Client.EmuHawk //build the default filter chain and set it up with services filters will need Size chainInsize = new Size(bufferWidth, bufferHeight); - var filterProgram = BuildDefaultChain(chainInsize, chainOutsize, job.IncludeOSD); + var filterProgram = BuildDefaultChain(chainInsize, chainOutsize, job.IncludeOSD, job.IncludeUserFilters); filterProgram.GuiRenderer = Renderer; filterProgram.GL = GL;