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

Code refactor: CheckForFrameBufferTexture - use fbList variable instead of calls to frameBufferList()

This commit is contained in:
Sergey Lipskiy 2015-09-26 21:09:31 +06:00
parent 874ebce5ca
commit bff19580eb

View File

@ -374,37 +374,38 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
if (!config.frameBufferEmulation.enable)
return false;
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
FrameBufferList & fbList = frameBufferList();
FrameBuffer *pBuffer = fbList.findBuffer(_address);
bool bRes = pBuffer != NULL;
if (bRes) {
if ((config.generalEmulation.hacks & hack_blurPauseScreen) != 0) {
if (gDP.colorImage.address == gDP.depthImageAddress && pBuffer->m_copiedToRdram) {
memcpy(RDRAM + gDP.depthImageAddress, RDRAM + pBuffer->m_startAddress, (pBuffer->m_width*pBuffer->m_height) << pBuffer->m_size >> 1);
pBuffer->m_copiedToRdram = false;
frameBufferList().getCurrent()->m_isPauseScreen = true;
fbList.getCurrent()->m_isPauseScreen = true;
}
if (pBuffer->m_isPauseScreen)
bRes = false;
}
if (pBuffer->m_cfb) {
frameBufferList().removeBuffer(pBuffer->m_startAddress);
fbList.removeBuffer(pBuffer->m_startAddress);
bRes = false;
}
if ((config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0 && pBuffer->m_isDepthBuffer) {
frameBufferList().removeBuffer(pBuffer->m_startAddress);
fbList.removeBuffer(pBuffer->m_startAddress);
bRes = false;
}
const u32 texEndAddress = _address + _bytes - 1;
if (_address > pBuffer->m_startAddress && texEndAddress > (pBuffer->m_endAddress + (pBuffer->m_width << pBuffer->m_size >> 1))) {
//frameBufferList().removeBuffer(pBuffer->m_startAddress);
//fbList.removeBuffer(pBuffer->m_startAddress);
bRes = false;
}
if (bRes && gDP.loadTile->loadType == LOADTYPE_TILE && gDP.textureImage.width != pBuffer->m_width && gDP.textureImage.size != pBuffer->m_size) {
//frameBufferList().removeBuffer(pBuffer->m_startAddress); // Does not work with Zelda MM
//fbList.removeBuffer(pBuffer->m_startAddress); // Does not work with Zelda MM
bRes = false;
}
@ -413,7 +414,7 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
if (bRes)
pBuffer->m_validityChecked = RSP.DList;
else
frameBufferList().removeBuffer(pBuffer->m_startAddress);
fbList.removeBuffer(pBuffer->m_startAddress);
}
if (bRes) {