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

Revert changes in FrameBuffer::getTexture made by commit 6942083

These changes are incorrect and cause regression in Paper Mario fortune teller.
This commit is contained in:
Sergey Lipskiy 2016-10-25 12:27:49 +07:00
parent e52918d07b
commit 57dbfb5145

View File

@ -381,30 +381,25 @@ CachedTexture * FrameBuffer::_getSubTexture(u32 _t)
CachedTexture * FrameBuffer::getTexture(u32 _t) CachedTexture * FrameBuffer::getTexture(u32 _t)
{ {
CachedTexture *pTexture = m_pTexture;
const bool getDepthTexture = m_isDepthBuffer && const bool getDepthTexture = m_isDepthBuffer &&
gDP.colorImage.address == gDP.depthImageAddress && gDP.colorImage.address == gDP.depthImageAddress &&
m_pDepthBuffer != nullptr && m_pDepthBuffer != nullptr &&
(config.generalEmulation.hacks & hack_ZeldaMM) == 0; (config.generalEmulation.hacks & hack_ZeldaMM) == 0;
CachedTexture *pTexture = getDepthTexture ? m_pDepthBuffer->m_pDepthBufferTexture : m_pTexture;
if (getDepthTexture) const u32 shift = (gSP.textureTile[_t]->imageAddress - m_startAddress) >> (m_size - 1);
pTexture = m_pDepthBuffer->m_pDepthBufferTexture; const u32 factor = m_width;
else if (gSP.textureTile[_t]->clamps == 0 || gSP.textureTile[_t]->clampt == 0) if (m_loadType == LOADTYPE_TILE) {
pTexture = _getSubTexture(_t); pTexture->offsetS = (float)(m_loadTileOrigin.uls + (shift % factor));
pTexture->offsetT = (float)(m_height - (m_loadTileOrigin.ult + shift / factor));
if (pTexture != m_pSubTexture) { } else {
const u32 shift = (gSP.textureTile[_t]->imageAddress - m_startAddress) >> (m_size - 1); pTexture->offsetS = (float)(shift % factor);
const u32 factor = m_width; pTexture->offsetT = (float)(m_height - shift / factor);
if (m_loadType == LOADTYPE_TILE) {
pTexture->offsetS = (float)(m_loadTileOrigin.uls + (shift % factor));
pTexture->offsetT = (float)(m_height - (m_loadTileOrigin.ult + shift / factor));
} else {
pTexture->offsetS = (float)(shift % factor);
pTexture->offsetT = (float)(m_height - shift / factor);
}
} }
if (!getDepthTexture && (gSP.textureTile[_t]->clamps == 0 || gSP.textureTile[_t]->clampt == 0))
pTexture = _getSubTexture(_t);
pTexture->scaleS = m_scaleX / (float)pTexture->realWidth; pTexture->scaleS = m_scaleX / (float)pTexture->realWidth;
pTexture->scaleT = m_scaleY / (float)pTexture->realHeight; pTexture->scaleT = m_scaleY / (float)pTexture->realHeight;