mirror of https://github.com/mgba-emu/mgba.git
Qt: Ensure camera image is valid
This commit is contained in:
parent
2bfc3e0ca6
commit
2d5bfe3321
1
CHANGES
1
CHANGES
|
@ -120,6 +120,7 @@ Misc:
|
||||||
- Wii: Define _GNU_SOURCE (fixes mgba.io/i/1106)
|
- Wii: Define _GNU_SOURCE (fixes mgba.io/i/1106)
|
||||||
- Wii: Expose stretch configuration in settings
|
- Wii: Expose stretch configuration in settings
|
||||||
- Wii: Stretch now sets pixel-accurate mode size cap
|
- Wii: Stretch now sets pixel-accurate mode size cap
|
||||||
|
- Qt: Ensure camera image is valid
|
||||||
|
|
||||||
0.7 beta 1: (2018-09-24)
|
0.7 beta 1: (2018-09-24)
|
||||||
- Initial beta for 0.7
|
- Initial beta for 0.7
|
||||||
|
|
|
@ -678,13 +678,13 @@ void InputController::releaseFocus(QWidget* focus) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputController::loadCamImage(const QString& path) {
|
void InputController::loadCamImage(const QString& path) {
|
||||||
QMutexLocker locker(&m_image.mutex);
|
setCamImage(QImage(path));
|
||||||
m_image.image.load(path);
|
|
||||||
m_image.resizedImage = QImage();
|
|
||||||
m_image.outOfDate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputController::setCamImage(const QImage& image) {
|
void InputController::setCamImage(const QImage& image) {
|
||||||
|
if (image.isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
QMutexLocker locker(&m_image.mutex);
|
QMutexLocker locker(&m_image.mutex);
|
||||||
m_image.image = image;
|
m_image.image = image;
|
||||||
m_image.resizedImage = QImage();
|
m_image.resizedImage = QImage();
|
||||||
|
|
Loading…
Reference in New Issue