From 1fb78594c84cda3cbb2ea2d15cbe9696defcf57a Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 25 Sep 2015 12:21:20 +0600 Subject: [PATCH] Fix buffer end address calculation in FrameBuffer::reinit. Fixed regression in Pokemon Stadium 2: the bottom of the portraits is cut off, see #415 --- src/FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index fc749166..9914519d 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -229,7 +229,7 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1 void FrameBuffer::reinit(u16 _height) { const u16 format = m_pTexture->format; - const u32 endAddress = m_startAddress + ((m_width * (_height - 1)) << m_size >> 1) - 1; + const u32 endAddress = m_startAddress + ((m_width * _height) << m_size >> 1) - 1; if (m_pTexture != NULL) textureCache().removeFrameBufferTexture(m_pTexture); if (m_resolveFBO != 0)