mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix timing issues on high refresh rate monitors
This commit is contained in:
parent
3064949029
commit
629c5bf76c
1
CHANGES
1
CHANGES
|
@ -5,6 +5,7 @@ Bugfixes:
|
|||
- Libretro: Fix saving in GB games (fixes mgba.io/i/486)
|
||||
- LR35902: Fix pc overflowing current region off-by-one
|
||||
- GB MBC: Fix ROM bank overflows getting set to bank 0
|
||||
- Qt: Fix timing issues on high refresh rate monitors
|
||||
Misc:
|
||||
- Qt: Improved HiDPI support
|
||||
- Feature: Support ImageMagick 7
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QResizeEvent>
|
||||
#include <QTimer>
|
||||
|
||||
extern "C" {
|
||||
#include "core/core.h"
|
||||
|
@ -319,6 +320,16 @@ void PainterGL::draw() {
|
|||
if (m_queue.isEmpty() || !mCoreThreadIsActive(m_context)) {
|
||||
return;
|
||||
}
|
||||
if (!m_delayTimer.isValid()) {
|
||||
m_delayTimer.start();
|
||||
} else if (m_delayTimer.elapsed() < 16) {
|
||||
QMetaObject::invokeMethod(this, "draw", Qt::QueuedConnection);
|
||||
QThread::usleep(500);
|
||||
return;
|
||||
} else {
|
||||
m_delayTimer.restart();
|
||||
}
|
||||
|
||||
if (mCoreSyncWaitFrameStart(&m_context->sync) || !m_queue.isEmpty()) {
|
||||
dequeue();
|
||||
mCoreSyncWaitFrameEnd(&m_context->sync);
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QGLWidget>
|
||||
#include <QList>
|
||||
#include <QMouseEvent>
|
||||
#include <QQueue>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
|
||||
extern "C" {
|
||||
#include "platform/video-backend.h"
|
||||
|
@ -122,6 +122,7 @@ private:
|
|||
VideoBackend* m_backend;
|
||||
QSize m_size;
|
||||
MessagePainter* m_messagePainter;
|
||||
QElapsedTimer m_delayTimer;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue