From fe6447070e140bd99de05d220973ec63ee0d92f2 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 17 Oct 2018 15:49:21 +0700 Subject: [PATCH] Minor code refactor in gDPFillRectangle --- src/gDP.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gDP.cpp b/src/gDP.cpp index 51aa581d..a2b6ab61 100644 --- a/src/gDP.cpp +++ b/src/gDP.cpp @@ -707,7 +707,6 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) if (gDP.fillColor.color == DepthClearColor) { depthBuffer = dbFound; if (config.generalEmulation.enableFragmentDepthWrite == 0) { - frameBufferList().fillRDRAM(ulx, uly, lrx, lry); drawer.clearDepthBuffer(); depthBuffer = dbCleared; } else @@ -718,7 +717,6 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) depthBufferList().saveBuffer(gDP.colorImage.address); if (config.generalEmulation.enableFragmentDepthWrite == 0 || (config.generalEmulation.hacks & hack_Snap) != 0) { - frameBufferList().fillRDRAM(ulx, uly, lrx, lry); drawer.clearDepthBuffer(); depthBuffer = dbCleared; } else @@ -727,7 +725,6 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) if (depthBuffer != dbCleared) { if (gDP.otherMode.cycleType == G_CYC_FILL) { - frameBufferList().fillRDRAM(ulx, uly, lrx, lry); f32 fillColor[4]; gDPGetFillColor(fillColor); gDP.rectColor.r = fillColor[0]; @@ -740,6 +737,9 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) drawer.drawRect(ulx, uly, lrx, lry); } + if (gDP.otherMode.cycleType == G_CYC_FILL) + frameBufferList().fillRDRAM(ulx, uly, lrx, lry); + frameBufferList().setBufferChanged(f32(lry)); DebugMsg( DEBUG_NORMAL, "gDPFillRectangle #%i- #%i ( %i, %i, %i, %i );\n", gSP.tri_num, gSP.tri_num +1, ulx, uly, lrx, lry );