From 7418f76968b3d94266a2fbd63a993645c99e11d7 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 29 Jun 2013 18:51:06 +0700 Subject: [PATCH] Frame buffer emulation fixes: clear color buffer when size is changed but address is the same. --- FrameBuffer.cpp | 10 +++++++++- gDP.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/FrameBuffer.cpp b/FrameBuffer.cpp index e86a09e2..102a94f3 100644 --- a/FrameBuffer.cpp +++ b/FrameBuffer.cpp @@ -167,7 +167,7 @@ void FrameBuffer_SaveBuffer( u32 address, u16 format, u16 size, u16 width, u16 h if ((current->startAddress != address) || (current->width != width) || //(current->height != height) || - (current->size != size) || // TODO FIX ME + //(current->size != size) || // TODO FIX ME (current->scaleX != OGL.scaleX) || (current->scaleY != OGL.scaleY)) { @@ -178,6 +178,14 @@ void FrameBuffer_SaveBuffer( u32 address, u16 format, u16 size, u16 width, u16 h FrameBuffer_MoveToTop( current ); ogl_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current->fbo); + if (current->size != size) { + f32 fillColor[4]; + gDPGetFillColor(fillColor); + OGL_ClearColorBuffer(fillColor); + current->size = size; + current->texture->format = format; + current->texture->size = size; + } break; } current = current->lower; diff --git a/gDP.cpp b/gDP.cpp index b9e387cc..ed5b3764 100644 --- a/gDP.cpp +++ b/gDP.cpp @@ -347,7 +347,7 @@ void gDPSetColorImage( u32 format, u32 size, u32 width, u32 address ) }*/ address = RSP_SegmentToPhysical( address ); - if (gDP.colorImage.address != address || gDP.colorImage.width != width) + if (gDP.colorImage.address != address || gDP.colorImage.width != width || gDP.colorImage.size != size) { if (width == VI.width) { if (width == gSP.viewport.width)