mirror of https://github.com/mgba-emu/mgba.git
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,7 +594,16 @@ void FrameView::exportFrame() {
|
|||
return;
|
||||
}
|
||||
CoreController::Interrupter interrupter(m_controller);
|
||||
m_framebuffer.save(filename, "PNG");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
void FrameView::reset() {
|
||||
|
|
Loading…
Reference in New Issue