1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fix FrameBufferToRDRAM::_prepareCopy

Wrong buffer could be used when several buffers copied per frame
This commit is contained in:
Sergey Lipskiy 2015-12-05 21:46:07 +06:00
parent 0b12d3b26e
commit 148349a00a

View File

@ -1045,13 +1045,14 @@ void FrameBufferToRDRAM::Destroy() {
bool FrameBufferToRDRAM::_prepareCopy(u32 _address)
{
const u32 curFrame = video().getBuffersSwapCount();
if (m_frameCount == curFrame)
FrameBuffer * pBuffer = frameBufferList().findBuffer(_address);
if (m_frameCount == curFrame && pBuffer == m_pCurFrameBuffer)
return true;
if (VI.width == 0 || frameBufferList().getCurrent() == NULL)
return false;
m_pCurFrameBuffer = frameBufferList().findBuffer(_address);
m_pCurFrameBuffer = pBuffer;
if (m_pCurFrameBuffer == NULL || m_pCurFrameBuffer->m_isOBScreen)
return false;