mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix bug in FrameBuffer_SaveBuffer:
don't use removed buffer
This commit is contained in:
parent
31d236f59b
commit
35ab89d379
|
@ -216,20 +216,21 @@ void FrameBuffer_SaveBuffer( u32 address, u16 format, u16 size, u16 width, u16 h
|
||||||
{
|
{
|
||||||
FrameBuffer_Remove( current );
|
FrameBuffer_Remove( current );
|
||||||
current = NULL;
|
current = NULL;
|
||||||
|
} else {
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FrameBuffer_MoveToTop( current );
|
if (current == NULL) {
|
||||||
ogl_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current->fbo);
|
// Wasn't found or removed, create a new one
|
||||||
if (current->size != size) {
|
|
||||||
f32 fillColor[4];
|
|
||||||
gDPGetFillColor(fillColor);
|
|
||||||
OGL_ClearColorBuffer(fillColor);
|
|
||||||
current->size = size;
|
|
||||||
current->texture->format = format;
|
|
||||||
current->texture->size = size;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Wasn't found, create a new one
|
|
||||||
current = FrameBuffer_AddTop();
|
current = FrameBuffer_AddTop();
|
||||||
|
|
||||||
current->startAddress = address;
|
current->startAddress = address;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user