From 0732c337c523d00c6c37429639fd5a37e2659bd2 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sat, 1 Jan 2011 16:11:44 +0000 Subject: [PATCH] OGL: Clean up ClearScreen git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6709 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 1434c1c793..5448edd378 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -851,28 +851,20 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE glDepthFunc(GL_NEVER); } - glEnable(GL_SCISSOR_TEST); - - // Update the viewport and scissor rect for clearing the picture + // Update viewport for clearing the picture TargetRectangle targetRc = ConvertEFBRectangle(rc); glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); - glScissor(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); - glDepthRange(0.0, 1.0); + glDepthRange(0.0, (float)(z & 0xFFFFFF) / float(0xFFFFFF)); glColor4f((float)((color >> 16) & 0xFF) / 255.0f, (float)((color >> 8) & 0xFF) / 255.0f, (float)(color & 0xFF) / 255.0f, (float)((color >> 24) & 0xFF) / 255.0f); - float zval = -1.f + 2.f * (float)(z & 0xFFFFFF) / float(0xFFFFFF); // convert range [0;1] to [-1;1] - if(zval > 1.0f) - zval = 1.0f; - if(zval < -1.0f) - zval = -1.0f; glBegin(GL_QUADS); - glVertex3f(-1.f, -1.f, zval); - glVertex3f(-1.f, 1.f, zval); - glVertex3f( 1.f, 1.f, zval); - glVertex3f( 1.f, -1.f, zval); + glVertex3f(-1.f, -1.f, 1.f); + glVertex3f(-1.f, 1.f, 1.f); + glVertex3f( 1.f, 1.f, 1.f); + glVertex3f( 1.f, -1.f, 1.f); glEnd(); RestoreAPIState();