From 61e6eb268c06e9594025f577badf8f897cdcf071 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 21 Mar 2015 14:18:55 +0600 Subject: [PATCH] Correct condition for buffers removal in VI_UpdateSize() : remove buffers when interlace mode changed or when main buffer width changed. --- VI.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/VI.cpp b/VI.cpp index bea1faee..7b5cc89b 100644 --- a/VI.cpp +++ b/VI.cpp @@ -66,9 +66,11 @@ void VI_UpdateSize() // const int fsaa = ((*REG.VI_STATUS) >> 8) & 3; // const int divot = ((*REG.VI_STATUS) >> 4) & 1; - if (config.frameBufferEmulation.enable && (interlacedPrev != VI.interlaced)) { - frameBufferList().removeBuffers(widthPrev); - frameBufferList().removeBuffers(VI.width); + FrameBufferList & fbList = frameBufferList(); + FrameBuffer * pBuffer = fbList.findBuffer(VI.lastOrigin); + if (config.frameBufferEmulation.enable && ((interlacedPrev != VI.interlaced) || (pBuffer != NULL && pBuffer->m_width != VI.width))) { + fbList.removeBuffers(widthPrev); + fbList.removeBuffers(VI.width); depthBufferList().destroy(); depthBufferList().init(); }