mirror of https://github.com/mgba-emu/mgba.git
Qt: Simplify high-framerate fix (fixes #545)
This commit is contained in:
parent
35b5626053
commit
4a38f9b979
|
@ -318,15 +318,6 @@ 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();
|
||||
|
@ -335,6 +326,14 @@ void PainterGL::draw() {
|
|||
performDraw();
|
||||
m_painter.end();
|
||||
m_backend->swap(m_backend);
|
||||
if (!m_delayTimer.isValid()) {
|
||||
m_delayTimer.start();
|
||||
} else {
|
||||
while (m_delayTimer.elapsed() < 15) {
|
||||
QThread::usleep(100);
|
||||
}
|
||||
m_delayTimer.restart();
|
||||
}
|
||||
} else {
|
||||
mCoreSyncWaitFrameEnd(&m_context->sync);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue