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

Do not remove auxilary color buffers on interlaced mode switch.

Fixed removal of color buffers with pokemon portraits in Pokemon Stadium 2.
This commit is contained in:
Sergey Lipskiy 2015-03-11 17:33:47 +06:00
parent ea3e81540b
commit 4e7a5a6b9e
3 changed files with 15 additions and 2 deletions

View File

@ -422,6 +422,18 @@ void FrameBufferList::removeBuffer(u32 _address )
}
}
void FrameBufferList::removeBuffers(u32 _width, u32 _height)
{
m_pCurrent = NULL;
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter) {
while (iter->m_width == _width && iter->m_height == _height) {
iter = m_list.erase(iter);
if (iter == m_list.end())
return;
}
}
}
void FrameBufferList::attachDepthBuffer()
{
if (m_pCurrent == NULL)

View File

@ -50,6 +50,7 @@ public:
void destroy();
void saveBuffer(u32 _address, u16 _format, u16 _size, u16 _width, u16 _height, bool _cfb);
void removeBuffer(u32 _address);
void removeBuffers(u32 _width, u32 _height);
void attachDepthBuffer();
FrameBuffer * findBuffer(u32 _startAddress);
FrameBuffer * findTmpBuffer(u32 _address);

4
VI.cpp
View File

@ -67,10 +67,10 @@ void VI_UpdateSize()
// const int divot = ((*REG.VI_STATUS) >> 4) & 1;
if (config.frameBufferEmulation.enable && (interlacedPrev != VI.interlaced || widthPrev != VI.width || heightPrev != VI.height)) {
frameBufferList().destroy();
frameBufferList().removeBuffers(widthPrev, heightPrev);
frameBufferList().removeBuffers(VI.width, VI.height);
depthBufferList().destroy();
depthBufferList().init();
frameBufferList().init();
}
VI.rwidth = VI.width != 0 ? 1.0f / VI.width : 0.0f;