Delete wrong format framebuffers instead.

This commit is contained in:
Unknown W. Brackets 2013-09-06 11:02:33 -07:00
parent 69e4b3487b
commit b56c9e5533

View file

@ -491,17 +491,22 @@ void FramebufferManager::SetRenderFrameBuffer() {
VirtualFramebuffer *vfb = 0;
for (size_t i = 0; i < vfbs_.size(); ++i) {
VirtualFramebuffer *v = vfbs_[i];
if (MaskedEqual(v->fb_address, fb_address) && (g_Config.bTrueColor || v->format == fmt)) {
// Let's not be so picky for now. Let's say this is the one.
vfb = v;
// Update fb stride in case it changed
vfb->fb_stride = fb_stride;
vfb->format = fmt;
if (v->bufferWidth >= drawing_width && v->bufferHeight >= drawing_height) {
v->width = drawing_width;
v->height = drawing_height;
if (MaskedEqual(v->fb_address, fb_address)) {
// Let's not be so picky, format is enough to match.
if (v->format == fmt) {
vfb = v;
// Update fb stride in case it changed
vfb->fb_stride = fb_stride;
if (v->bufferWidth >= drawing_width && v->bufferHeight >= drawing_height) {
v->width = drawing_width;
v->height = drawing_height;
}
break;
} else {
// Okay, let's burn this with fire, it's the wrong format, we're replacing it.
DestroyFramebuf(v);
vfbs_.erase(vfbs_.begin() + i--);
}
break;
}
}