mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 15:40:16 +00:00
OGL: Clean up ClearScreen
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6709 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
28ef121a93
commit
0732c337c5
@ -851,28 +851,20 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
|||||||
glDepthFunc(GL_NEVER);
|
glDepthFunc(GL_NEVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_SCISSOR_TEST);
|
// Update viewport for clearing the picture
|
||||||
|
|
||||||
// Update the viewport and scissor rect for clearing the picture
|
|
||||||
TargetRectangle targetRc = ConvertEFBRectangle(rc);
|
TargetRectangle targetRc = ConvertEFBRectangle(rc);
|
||||||
glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
|
glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
|
||||||
glScissor(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
|
glDepthRange(0.0, (float)(z & 0xFFFFFF) / float(0xFFFFFF));
|
||||||
glDepthRange(0.0, 1.0);
|
|
||||||
|
|
||||||
glColor4f((float)((color >> 16) & 0xFF) / 255.0f,
|
glColor4f((float)((color >> 16) & 0xFF) / 255.0f,
|
||||||
(float)((color >> 8) & 0xFF) / 255.0f,
|
(float)((color >> 8) & 0xFF) / 255.0f,
|
||||||
(float)(color & 0xFF) / 255.0f,
|
(float)(color & 0xFF) / 255.0f,
|
||||||
(float)((color >> 24) & 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);
|
glBegin(GL_QUADS);
|
||||||
glVertex3f(-1.f, -1.f, zval);
|
glVertex3f(-1.f, -1.f, 1.f);
|
||||||
glVertex3f(-1.f, 1.f, zval);
|
glVertex3f(-1.f, 1.f, 1.f);
|
||||||
glVertex3f( 1.f, 1.f, zval);
|
glVertex3f( 1.f, 1.f, 1.f);
|
||||||
glVertex3f( 1.f, -1.f, zval);
|
glVertex3f( 1.f, -1.f, 1.f);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
RestoreAPIState();
|
RestoreAPIState();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user