mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Code refactor: CheckForFrameBufferTexture - use fbList variable instead of calls to frameBufferList()
This commit is contained in:
parent
874ebce5ca
commit
bff19580eb
15
src/gDP.cpp
15
src/gDP.cpp
|
@ -374,37 +374,38 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
|
||||||
if (!config.frameBufferEmulation.enable)
|
if (!config.frameBufferEmulation.enable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
|
FrameBufferList & fbList = frameBufferList();
|
||||||
|
FrameBuffer *pBuffer = fbList.findBuffer(_address);
|
||||||
bool bRes = pBuffer != NULL;
|
bool bRes = pBuffer != NULL;
|
||||||
if (bRes) {
|
if (bRes) {
|
||||||
if ((config.generalEmulation.hacks & hack_blurPauseScreen) != 0) {
|
if ((config.generalEmulation.hacks & hack_blurPauseScreen) != 0) {
|
||||||
if (gDP.colorImage.address == gDP.depthImageAddress && pBuffer->m_copiedToRdram) {
|
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);
|
memcpy(RDRAM + gDP.depthImageAddress, RDRAM + pBuffer->m_startAddress, (pBuffer->m_width*pBuffer->m_height) << pBuffer->m_size >> 1);
|
||||||
pBuffer->m_copiedToRdram = false;
|
pBuffer->m_copiedToRdram = false;
|
||||||
frameBufferList().getCurrent()->m_isPauseScreen = true;
|
fbList.getCurrent()->m_isPauseScreen = true;
|
||||||
}
|
}
|
||||||
if (pBuffer->m_isPauseScreen)
|
if (pBuffer->m_isPauseScreen)
|
||||||
bRes = false;
|
bRes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pBuffer->m_cfb) {
|
if (pBuffer->m_cfb) {
|
||||||
frameBufferList().removeBuffer(pBuffer->m_startAddress);
|
fbList.removeBuffer(pBuffer->m_startAddress);
|
||||||
bRes = false;
|
bRes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0 && pBuffer->m_isDepthBuffer) {
|
if ((config.generalEmulation.hacks & hack_noDepthFrameBuffers) != 0 && pBuffer->m_isDepthBuffer) {
|
||||||
frameBufferList().removeBuffer(pBuffer->m_startAddress);
|
fbList.removeBuffer(pBuffer->m_startAddress);
|
||||||
bRes = false;
|
bRes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 texEndAddress = _address + _bytes - 1;
|
const u32 texEndAddress = _address + _bytes - 1;
|
||||||
if (_address > pBuffer->m_startAddress && texEndAddress > (pBuffer->m_endAddress + (pBuffer->m_width << pBuffer->m_size >> 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;
|
bRes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bRes && gDP.loadTile->loadType == LOADTYPE_TILE && gDP.textureImage.width != pBuffer->m_width && gDP.textureImage.size != pBuffer->m_size) {
|
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;
|
bRes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +414,7 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
|
||||||
if (bRes)
|
if (bRes)
|
||||||
pBuffer->m_validityChecked = RSP.DList;
|
pBuffer->m_validityChecked = RSP.DList;
|
||||||
else
|
else
|
||||||
frameBufferList().removeBuffer(pBuffer->m_startAddress);
|
fbList.removeBuffer(pBuffer->m_startAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bRes) {
|
if (bRes) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user