mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Implement depth buffer copy for Mario Golf.
Fix Mario Golf: Animated effects render in front of course #312
This commit is contained in:
parent
bbcd0be949
commit
7dca7f8f4d
|
@ -382,19 +382,23 @@ CachedTexture * FrameBuffer::_getSubTexture(u32 _t)
|
||||||
|
|
||||||
CachedTexture * FrameBuffer::getTexture(u32 _t)
|
CachedTexture * FrameBuffer::getTexture(u32 _t)
|
||||||
{
|
{
|
||||||
|
const bool getDepthTexture = m_isDepthBuffer &&
|
||||||
|
gDP.colorImage.address == gDP.depthImageAddress &&
|
||||||
|
m_pDepthBuffer != nullptr;
|
||||||
|
CachedTexture *pTexture = getDepthTexture ? m_pDepthBuffer->m_pDepthBufferTexture : m_pTexture;
|
||||||
|
|
||||||
const u32 shift = (gSP.textureTile[_t]->imageAddress - m_startAddress) >> (m_size - 1);
|
const u32 shift = (gSP.textureTile[_t]->imageAddress - m_startAddress) >> (m_size - 1);
|
||||||
const u32 factor = m_width;
|
const u32 factor = m_width;
|
||||||
if (m_loadType == LOADTYPE_TILE) {
|
if (m_loadType == LOADTYPE_TILE) {
|
||||||
m_pTexture->offsetS = (float)(m_loadTileOrigin.uls + (shift % factor));
|
pTexture->offsetS = (float)(m_loadTileOrigin.uls + (shift % factor));
|
||||||
m_pTexture->offsetT = (float)(m_height - (m_loadTileOrigin.ult + shift / factor));
|
pTexture->offsetT = (float)(m_height - (m_loadTileOrigin.ult + shift / factor));
|
||||||
} else {
|
} else {
|
||||||
m_pTexture->offsetS = (float)(shift % factor);
|
pTexture->offsetS = (float)(shift % factor);
|
||||||
m_pTexture->offsetT = (float)(m_height - shift / factor);
|
pTexture->offsetT = (float)(m_height - shift / factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
CachedTexture *pTexture = m_pTexture;
|
|
||||||
// if (gSP.textureTile[_t]->loadType == LOADTYPE_TILE && pTexture->size > 1)
|
// if (gSP.textureTile[_t]->loadType == LOADTYPE_TILE && pTexture->size > 1)
|
||||||
if (gSP.textureTile[_t]->clamps == 0 || gSP.textureTile[_t]->clampt == 0)
|
if (!getDepthTexture && (gSP.textureTile[_t]->clamps == 0 || gSP.textureTile[_t]->clampt == 0))
|
||||||
pTexture = _getSubTexture(_t);
|
pTexture = _getSubTexture(_t);
|
||||||
|
|
||||||
pTexture->scaleS = m_scaleX / (float)pTexture->realWidth;
|
pTexture->scaleS = m_scaleX / (float)pTexture->realWidth;
|
||||||
|
|
|
@ -321,8 +321,7 @@ void RSP_Init()
|
||||||
config.generalEmulation.hacks = 0;
|
config.generalEmulation.hacks = 0;
|
||||||
if (strstr(RSP.romname, (const char *)"OgreBattle64") != nullptr)
|
if (strstr(RSP.romname, (const char *)"OgreBattle64") != nullptr)
|
||||||
config.generalEmulation.hacks |= hack_Ogre64;
|
config.generalEmulation.hacks |= hack_Ogre64;
|
||||||
else if (strstr(RSP.romname, (const char *)"MarioGolf64") != nullptr ||
|
else if (strstr(RSP.romname, (const char *)"F1 POLE POSITION 64") != nullptr)
|
||||||
strstr(RSP.romname, (const char *)"F1 POLE POSITION 64") != nullptr)
|
|
||||||
config.generalEmulation.hacks |= hack_noDepthFrameBuffers;
|
config.generalEmulation.hacks |= hack_noDepthFrameBuffers;
|
||||||
else if (strstr(RSP.romname, (const char *)"CONKER BFD") != nullptr)
|
else if (strstr(RSP.romname, (const char *)"CONKER BFD") != nullptr)
|
||||||
config.generalEmulation.hacks |= hack_blurPauseScreen | hack_rectDepthBufferCopyCBFD;
|
config.generalEmulation.hacks |= hack_blurPauseScreen | hack_rectDepthBufferCopyCBFD;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user