Qt: Ensure camera image is valid

This commit is contained in:
Vicki Pfau 2018-10-01 12:07:56 -07:00
parent 2bfc3e0ca6
commit 2d5bfe3321
2 changed files with 5 additions and 4 deletions

View File

@ -120,6 +120,7 @@ Misc:
- Wii: Define _GNU_SOURCE (fixes mgba.io/i/1106)
- Wii: Expose stretch configuration in settings
- Wii: Stretch now sets pixel-accurate mode size cap
- Qt: Ensure camera image is valid
0.7 beta 1: (2018-09-24)
- Initial beta for 0.7

View File

@ -678,13 +678,13 @@ void InputController::releaseFocus(QWidget* focus) {
}
void InputController::loadCamImage(const QString& path) {
QMutexLocker locker(&m_image.mutex);
m_image.image.load(path);
m_image.resizedImage = QImage();
m_image.outOfDate = true;
setCamImage(QImage(path));
}
void InputController::setCamImage(const QImage& image) {
if (image.isNull()) {
return;
}
QMutexLocker locker(&m_image.mutex);
m_image.image = image;
m_image.resizedImage = QImage();