1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix depth buffer clear when it is used as an auxilary color buffer.

This commit is contained in:
Sergey Lipskiy 2013-06-30 22:03:16 +07:00
parent c8f83889a8
commit 53d5b994f5

12
gDP.cpp
View File

@ -816,10 +816,16 @@ void gDPSetScissor( u32 mode, f32 ulx, f32 uly, f32 lrx, f32 lry )
void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry )
{
#define DEPTH_CLAER_COLOR 0xfffcfffc // The value usually used to clear depth buffer
if (gDP.depthImageAddress == gDP.colorImage.address) {
OGL_ClearDepthBuffer();
return;
} else if (gDP.fillColor.color == 0xfffcfffc) {
// Game may use depth texture as auxilary color texture. Example: Mario Tennis
// If color is not depth clear color, that is most likely the case
if (gDP.fillColor.color == DEPTH_CLAER_COLOR) {
OGL_ClearDepthBuffer();
return;
}
} else if (gDP.fillColor.color == DEPTH_CLAER_COLOR) {
DepthBuffer_SetBuffer( gDP.colorImage.address );
OGL_ClearDepthBuffer();
return;