mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Do not use clearDepthBuffer in FillRect. Use drawRect only.
This commit is contained in:
parent
6a7c64dd6b
commit
5e1c8a6b58
|
@ -671,8 +671,7 @@ public:
|
||||||
void update(bool _force) override
|
void update(bool _force) override
|
||||||
{
|
{
|
||||||
int renderTarget = 0;
|
int renderTarget = 0;
|
||||||
if ((gDP.colorImage.address == gDP.depthImageAddress ) ||
|
if (isCurrentColorImageDepthImage()) {
|
||||||
(gDP.fillColor.color == DepthClearColor && gDP.otherMode.cycleType == G_CYC_FILL)) {
|
|
||||||
renderTarget = gDP.otherMode.depthCompare + 1;
|
renderTarget = gDP.otherMode.depthCompare + 1;
|
||||||
}
|
}
|
||||||
uRenderTarget.set(renderTarget, _force);
|
uRenderTarget.set(renderTarget, _force);
|
||||||
|
|
|
@ -657,7 +657,7 @@ void GraphicsDrawer::_updateStates(DrawingState _drawingState) const
|
||||||
if (!config.generalEmulation.enableFragmentDepthWrite)
|
if (!config.generalEmulation.enableFragmentDepthWrite)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (gDP.colorImage.address == gDP.depthImageAddress &&
|
if (isCurrentColorImageDepthImage() &&
|
||||||
config.generalEmulation.enableFragmentDepthWrite != 0 &&
|
config.generalEmulation.enableFragmentDepthWrite != 0 &&
|
||||||
config.frameBufferEmulation.N64DepthCompare == 0 &&
|
config.frameBufferEmulation.N64DepthCompare == 0 &&
|
||||||
(config.generalEmulation.hacks & hack_ZeldaMM) == 0
|
(config.generalEmulation.hacks & hack_ZeldaMM) == 0
|
||||||
|
|
14
src/gDP.cpp
14
src/gDP.cpp
|
@ -27,6 +27,12 @@ using namespace std;
|
||||||
|
|
||||||
gDPInfo gDP;
|
gDPInfo gDP;
|
||||||
|
|
||||||
|
bool isCurrentColorImageDepthImage()
|
||||||
|
{
|
||||||
|
return (gDP.colorImage.address == gDP.depthImageAddress) ||
|
||||||
|
(gDP.fillColor.color == DepthClearColor && gDP.otherMode.cycleType == G_CYC_FILL);
|
||||||
|
}
|
||||||
|
|
||||||
void gDPSetOtherMode( u32 mode0, u32 mode1 )
|
void gDPSetOtherMode( u32 mode0, u32 mode1 )
|
||||||
{
|
{
|
||||||
gDP.otherMode.h = mode0;
|
gDP.otherMode.h = mode0;
|
||||||
|
@ -705,9 +711,7 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry )
|
||||||
if (gDP.fillColor.color == DepthClearColor) {
|
if (gDP.fillColor.color == DepthClearColor) {
|
||||||
frameBufferList().fillRDRAM(ulx, uly, lrx, lry);
|
frameBufferList().fillRDRAM(ulx, uly, lrx, lry);
|
||||||
depthBuffer = dbFound;
|
depthBuffer = dbFound;
|
||||||
if (config.frameBufferEmulation.N64DepthCompare == 0 &&
|
if (config.generalEmulation.enableFragmentDepthWrite == 0) {
|
||||||
(config.generalEmulation.enableFragmentDepthWrite == 0 ||
|
|
||||||
(ulx == 0 && uly == 0 && lrx == gDP.scissor.lrx && lry == gDP.scissor.lry))) {
|
|
||||||
drawer.clearDepthBuffer(ulx, uly, lrx, lry);
|
drawer.clearDepthBuffer(ulx, uly, lrx, lry);
|
||||||
depthBuffer = dbCleared;
|
depthBuffer = dbCleared;
|
||||||
} else
|
} else
|
||||||
|
@ -717,9 +721,7 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry )
|
||||||
depthBuffer = dbFound;
|
depthBuffer = dbFound;
|
||||||
depthBufferList().saveBuffer(gDP.colorImage.address);
|
depthBufferList().saveBuffer(gDP.colorImage.address);
|
||||||
frameBufferList().fillRDRAM(ulx, uly, lrx, lry);
|
frameBufferList().fillRDRAM(ulx, uly, lrx, lry);
|
||||||
if (config.frameBufferEmulation.N64DepthCompare == 0 &&
|
if (config.generalEmulation.enableFragmentDepthWrite == 0) {
|
||||||
(config.generalEmulation.enableFragmentDepthWrite == 0 ||
|
|
||||||
(ulx == 0 && uly == 0 && lrx == gDP.scissor.lrx && lry == gDP.scissor.lry))) {
|
|
||||||
drawer.clearDepthBuffer(ulx, uly, lrx, lry);
|
drawer.clearDepthBuffer(ulx, uly, lrx, lry);
|
||||||
depthBuffer = dbCleared;
|
depthBuffer = dbCleared;
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user