Various ClearScreen fixes.

Will fix some games and break some others.
Assist trophies in SSBB work fine now, Super Mario Sunshine is a little broken again.
Still needs some more work...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6627 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-12-20 16:57:29 +00:00
parent 83868566ea
commit 9ebf507a55
4 changed files with 92 additions and 29 deletions

View File

@ -661,8 +661,9 @@ bool Renderer::SetScissorRect()
void Renderer::SetColorMask()
{
// Only enable alpha channel if it's supported by the current EFB format
GLenum ColorMask = (bpmem.blendmode.colorupdate) ? GL_TRUE : GL_FALSE;
GLenum AlphaMask = (bpmem.blendmode.alphaupdate) ? GL_TRUE : GL_FALSE;
GLenum AlphaMask = (bpmem.blendmode.alphaupdate && (bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24)) ? GL_TRUE : GL_FALSE;
glColorMask(ColorMask, ColorMask, ColorMask, AlphaMask);
}
@ -807,13 +808,13 @@ void Renderer::UpdateViewport()
glDepthRange(GLNear, GLFar);
}
// TODO: Clearing RGB or alpha only isn't implemented, yet!
void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z)
{
// Update the view port for clearing the picture
TargetRectangle targetRc = ConvertEFBRectangle(rc);
glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
// Always set the scissor in case it was set by the game and has not been reset
glScissor(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
@ -1557,4 +1558,4 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
return result;
}
}
}