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

Fix GL Errors in Pokemon Stadium 2 minigames.

Graphics became corrupt when the GL errors happened. With this change,
graphics no longer become corrupt.
This commit is contained in:
Francisco Zurita 2016-11-02 00:13:50 -04:00 committed by Sergey Lipskiy
parent 617517737d
commit 472c31986c

View File

@ -387,7 +387,7 @@ void DepthBufferList::saveBuffer(u32 _address)
pDepthBuffer = nullptr;
}
if (pDepthBuffer == nullptr) {
if (pDepthBuffer == nullptr && VI.height != 0) {
m_list.emplace_front();
DepthBuffer & buffer = m_list.front();
@ -399,18 +399,20 @@ void DepthBufferList::saveBuffer(u32 _address)
pDepthBuffer = &buffer;
}
DepthBuffer * pCurrent = m_pCurrent;
m_pCurrent = pDepthBuffer;
frameBufferList().attachDepthBuffer();
if (pDepthBuffer->m_address != gDP.depthImageAddress)
m_pCurrent = pCurrent;
//Check for null since the depth buffer will not be initialized if VI.height == 0
if(pDepthBuffer != nullptr) {
DepthBuffer * pCurrent = m_pCurrent;
m_pCurrent = pDepthBuffer;
frameBufferList().attachDepthBuffer();
if (pDepthBuffer->m_address != gDP.depthImageAddress)
m_pCurrent = pCurrent;
}
#ifdef DEBUG
DebugMsg( DEBUG_HIGH | DEBUG_HANDLED, "DepthBuffer_SetBuffer( 0x%08X ); color buffer is 0x%08X\n",
address, ( pFrameBuffer != nullptr && pFrameBuffer->m_FBO > 0) ? pFrameBuffer->m_startAddress : 0
);
DebugMsg( DEBUG_HIGH | DEBUG_HANDLED, "DepthBuffer_SetBuffer( 0x%08X ); color buffer is 0x%08X\n",
address, ( pFrameBuffer != nullptr && pFrameBuffer->m_FBO > 0) ? pFrameBuffer->m_startAddress : 0
);
#endif
}
void DepthBufferList::clearBuffer(u32 _ulx, u32 _uly, u32 _lrx, u32 _lry)