From 2442c24aeef77309817b0e7201abd458bf1d4e92 Mon Sep 17 00:00:00 2001 From: raven02 Date: Sun, 25 Aug 2013 20:52:08 +0800 Subject: [PATCH] Use stenciltest for glblendFuncSeparate() 1 --- GPU/GLES/StateMapping.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 37ddbe6bfc..15b45189f0 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -217,14 +217,14 @@ void TransformDrawEngine::ApplyDrawState(int prim) { } // At this point, through all paths above, glBlendFuncA and glBlendFuncB will be set right somehow. -#if 1 - // Fixes some Persona 2 issues, may be correct? (that is, don't change dest alpha at all if blending) - // If this doesn't break anything else, it's likely to be right. - // I guess an alternative solution would be to simply disable alpha writes if alpha blending is enabled. - glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE); -#else - glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB); -#endif + if (!gstate.isStencilTestEnabled()) { + // Fixes some Persona 2 issues, may be correct? (that is, don't change dest alpha at all if blending) + // If this doesn't break anything else, it's likely to be right. + // I guess an alternative solution would be to simply disable alpha writes if alpha blending is enabled. + glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE); + } else { + glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB); + } glstate.blendEquation.set(eqLookup[blendFuncEq]); }