all repos — mgba @ bfb697384913e2dcc16de710d05e2a354aed4244

mGBA Game Boy Advance Emulator

Qt: Fix camera image being upside-down sometimes (fixes #829 again)
Vicki Pfau vi@endrift.com
Thu, 10 Sep 2020 23:17:47 -0700
commit

bfb697384913e2dcc16de710d05e2a354aed4244

parent

0058ddd9752724c6ef40aa06b5a57868cb51d407

2 files changed, 6 insertions(+), 6 deletions(-)

jump to
M CHANGESCHANGES

@@ -20,6 +20,7 @@ - GBA: Fix endianness issues in renderer proxy

- GBA Core: Fix memory leak when loading symbols - Qt: Add dummy English translation file (fixes mgba.io/i/1469) - Qt: Fix Battle Chip view not displaying chips on some DPI settings + - Qt: Fix camera image being upside-down sometimes (fixes mgba.io/i/829 again) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - VFS: Fix directory node listing on some filesystems
M src/platform/qt/VideoDumper.cppsrc/platform/qt/VideoDumper.cpp

@@ -6,6 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "VideoDumper.h" #include <QImage> +#include <QVideoSurfaceFormat> using namespace QGBA;

@@ -40,13 +41,11 @@ uchar* bits = mappedFrame.bits();

QImage image(bits, mappedFrame.width(), mappedFrame.height(), mappedFrame.bytesPerLine(), format); if (swap) { image = image.rgbSwapped(); - } else { -#ifdef Q_OS_WIN - // Qt's DirectShow plug-in is pretty dang buggy - image = image.mirrored(); -#else + } else if (surfaceFormat().scanLineDirection() != QVideoSurfaceFormat::BottomToTop) { image = image.copy(); // Create a deep copy of the bits -#endif + } + if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { + image = image.mirrored(); } mappedFrame.unmap(); emit imageAvailable(image);