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

Add special frame buffer flag for Ogre Battle backgrounds.

It should protect such buffers from being overwritten by FrameBufferToRDRAM::CopyToRDRAM.
This commit is contained in:
Sergey Lipskiy 2015-03-09 18:17:45 +06:00
parent 2f83ab8963
commit e9b406d134
3 changed files with 6 additions and 2 deletions

View File

@ -390,7 +390,7 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt
m_pCurrent->m_cleared = false;
m_pCurrent->m_isDepthBuffer = _address == gDP.depthImageAddress;
m_pCurrent->m_isPauseScreen = false;
m_pCurrent->m_isPauseScreen = m_pCurrent->m_isOBScreen = false;
gSP.changed |= CHANGED_TEXTURE;
}
@ -743,7 +743,7 @@ void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) {
if (VI.width == 0) // H width is zero. Don't copy
return;
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
if (pBuffer == NULL || pBuffer->m_width < VI.width)
if (pBuffer == NULL || pBuffer->m_width < VI.width || pBuffer->m_isOBScreen)
return;
_address = pBuffer->m_startAddress;

View File

@ -25,6 +25,7 @@ struct FrameBuffer
bool m_cfb;
bool m_isDepthBuffer;
bool m_isPauseScreen;
bool m_isOBScreen;
bool m_needHeightCorrection;
GLuint m_FBO;

View File

@ -2105,6 +2105,9 @@ void _drawYUVImageToFrameBuffer(const ObjCoordinates & _objCoords)
}
dst += ci_width - 16;
}
FrameBuffer *pBuffer = frameBufferList().getCurrent();
if (pBuffer != NULL)
pBuffer->m_isOBScreen = true;
}
void gSPObjRectangle(u32 sp)