From 4710cf7e37ff4df8e3e6545b715e6c27764ab3f7 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 27 Dec 2016 21:09:08 -0600 Subject: [PATCH] fix errors in ogl old 3d driver (recent changes from ogl 3.2 not fully ported) --- desmume/src/OGLRender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 60aea178f..90a8a4cd0 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -334,7 +334,7 @@ static const char *fragmentShader_100 = {"\ \n\ float vertW = (vtxPosition.w == 0.0) ? 0.00000001 : vtxPosition.w;\n\ // hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\ - float newFragDepth = (stateUseWDepth) ? vtxPosition.w/4096.0 : clamp( (floor((((vtxPosition.z/vertW) * 0.5 + 0.5) * 16777215.0) / 4.0) * 4.0) / 16777215.0, 0.0, 1.0);\n\ + float newFragDepthValue = (stateUseWDepth) ? vtxPosition.w/4096.0 : clamp( (floor((((vtxPosition.z/vertW) * 0.5 + 0.5) * 16777215.0) / 4.0) * 4.0) / 16777215.0, 0.0, 1.0);\n\ \n\ if ((polyMode != 3) || polyDrawShadow)\n\ {\n\ @@ -405,7 +405,7 @@ static const char *fragmentShader_100 = {"\ gl_FragData[1] = newFragDepth;\n\ gl_FragData[2] = newPolyID;\n\ gl_FragData[3] = newFogAttributes;\n\ - gl_FragDepth = newFragDepth;\n\ + gl_FragDepth = newFragDepthValue;\n\ }\n\ "};