Crop frame view exports to current video size
The base video size of the Game Boy core is the Super Game Boy’s resolution of 256×224 pixels. Previously frames were exported at that size, leading to a 160×144 frame surrounded by uninitialized memory. This assumes that the base size is always greater or equal to the current video size.
This commit is contained in:
parent
35b6003a7d
commit
c3f3d00f14
@ -594,8 +594,17 @@ void FrameView::exportFrame() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CoreController::Interrupter interrupter(m_controller);
|
CoreController::Interrupter interrupter(m_controller);
|
||||||
|
|
||||||
|
unsigned width, height;
|
||||||
|
m_vl->currentVideoSize(m_vl, &width, &height);
|
||||||
|
|
||||||
|
if ((int)width != m_framebuffer.width() || (int)height != m_framebuffer.height()) {
|
||||||
|
QImage crop = m_framebuffer.copy(0, 0, width, height);
|
||||||
|
crop.save(filename, "PNG");
|
||||||
|
} else {
|
||||||
m_framebuffer.save(filename, "PNG");
|
m_framebuffer.save(filename, "PNG");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FrameView::reset() {
|
void FrameView::reset() {
|
||||||
m_disabled.clear();
|
m_disabled.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user