From 3bfebd0910941d937f4b27ea6080614958c03dbc Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sun, 28 Aug 2016 16:00:50 +0700 Subject: [PATCH] Remove allocated frame buffer if its color depth is less then necessary. Fixed Majora's Mask screen turns red #790 Problem description: the game allocates 8bit aux frame buffer when enter to subscreen. When screen shrink effect started, the game allocates 16bit buffer on the same address. Since plugin already had buffer allocated, it reused that buffer. Since the buffer's texture had only red component, whole screen turned red. Fix: create new buffer if color depth of existing buffer is less than necessary. --- src/FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index a375bca5..6c23edb2 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -582,7 +582,7 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt if ((m_pCurrent->m_startAddress != _address) || (m_pCurrent->m_width != _width) || //(current->height != height) || - //(current->size != size) || // TODO FIX ME + (m_pCurrent->m_size < _size) || (m_pCurrent->m_scaleX != scaleX) || (m_pCurrent->m_scaleY != scaleY)) {