From 04d1bc385ad2be78bc4385ef6523e4f260224615 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Tue, 4 Jun 2013 21:05:56 +0700 Subject: [PATCH] Handle depth buffer clear when depth image is not set yet. --- gDP.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gDP.cpp b/gDP.cpp index 1ac45696..0f99815d 100644 --- a/gDP.cpp +++ b/gDP.cpp @@ -789,8 +789,11 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) if (buffer) buffer->cleared = TRUE; - if (gDP.depthImageAddress == gDP.colorImage.address) - { + if (gDP.depthImageAddress == gDP.colorImage.address) { + OGL_ClearDepthBuffer(); + return; + } else if (gDP.fillColor.color == 0xfffcfffc) { + DepthBuffer_SetBuffer( gDP.colorImage.address ); OGL_ClearDepthBuffer(); return; }