mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix depth buffer clear when it is used as an auxilary color buffer.
This commit is contained in:
parent
c8f83889a8
commit
53d5b994f5
12
gDP.cpp
12
gDP.cpp
|
@ -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 )
|
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) {
|
if (gDP.depthImageAddress == gDP.colorImage.address) {
|
||||||
OGL_ClearDepthBuffer();
|
// Game may use depth texture as auxilary color texture. Example: Mario Tennis
|
||||||
return;
|
// If color is not depth clear color, that is most likely the case
|
||||||
} else if (gDP.fillColor.color == 0xfffcfffc) {
|
if (gDP.fillColor.color == DEPTH_CLAER_COLOR) {
|
||||||
|
OGL_ClearDepthBuffer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (gDP.fillColor.color == DEPTH_CLAER_COLOR) {
|
||||||
DepthBuffer_SetBuffer( gDP.colorImage.address );
|
DepthBuffer_SetBuffer( gDP.colorImage.address );
|
||||||
OGL_ClearDepthBuffer();
|
OGL_ClearDepthBuffer();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user