From c8c160b4302a1475b36269f16ba1598876d0b310 Mon Sep 17 00:00:00 2001 From: daco65 Date: Sun, 12 Oct 2008 15:12:51 +0000 Subject: [PATCH] Patch by omegadox. fixed bloom git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@844 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp | 4 ++-- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 6 +++--- Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp index 4ef01530a6..47df636869 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp @@ -164,7 +164,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight float FactorH = 480.0f / (float)nBackbufferHeight; float Max = (FactorW < FactorH) ? FactorH : FactorW; - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) { MValueX = 1.0f / FactorW; MValueY = 1.0f / FactorH; @@ -619,7 +619,7 @@ void OpenGL_Update() float Max = (FactorW < FactorH) ? FactorH : FactorW; AR = (float)nBackbufferWidth / (float)nBackbufferHeight; - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) { MValueX = 1; MValueY = 1; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 9b19312ba1..0f6fef6fbb 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -459,7 +459,7 @@ void Renderer::ReinitView(int nNewWidth, int nNewHeight) } int Renderer::GetTargetWidth() { - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) return 640; else return nBackbufferWidth; // return the actual window width @@ -467,7 +467,7 @@ int Renderer::GetTargetWidth() int Renderer::GetTargetHeight() { - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) return 480; else return nBackbufferHeight; // return the actual window height @@ -562,7 +562,7 @@ void Renderer::FlushZBufferAlphaToTarget() for(int i = 1; i < 8; ++i) TextureMngr::DisableStage(i); GL_REPORT_ERRORD(); - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) { //TODO: Do Correctly in a bit float FactorW = (float)640 / (float)nBackbufferWidth; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp index 40c049ae67..869bb738d7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp @@ -392,7 +392,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) hei = ceil(fabs(2 * rawViewport[1])); } - if(g_Config.bStretchToFit) + if(g_Config.bStretchToFit && g_Config.renderToMainframe) { glViewport( (int)(rawViewport[3]-rawViewport[0]-342) + xoffs, @@ -428,7 +428,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = rawProjection[4]; - g_fProjectionMatrix[11] = -(0.0f-rawProjection[5]); + g_fProjectionMatrix[11] = rawProjection[5]; g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; @@ -449,7 +449,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs) g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[10] = rawProjection[4]; - g_fProjectionMatrix[11] = -(0.0f-rawProjection[5]); + g_fProjectionMatrix[11] = -rawProjection[5]; g_fProjectionMatrix[12] = 0; g_fProjectionMatrix[13] = 0;