Merge pull request #535 from Xele02/master

Limit Qt version FPS
This commit is contained in:
Henrik Rydgård 2013-01-29 22:48:15 -08:00
commit 5bda9d8fcc

View File

@ -1,6 +1,7 @@
#include "EmuThread.h"
#include <QThread>
#include <QElapsedTimer>
#include "Core/HLE/sceCtrl.h"
#include "Core/Config.h"
@ -97,8 +98,12 @@ void EmuThread::run()
#endif
host->BootDone();
QElapsedTimer timer;
while(running) {
//UpdateGamepad(*input_state);
timer.start();
UpdateInputState(input_state);
static const int mapping[12][2] = {
@ -144,7 +149,15 @@ void EmuThread::run()
if (coreState == CORE_NEXTFRAME) {
// set back to running for the next frame
coreState = CORE_RUNNING;
qint64 time = timer.elapsed();
const int frameTime = (1.0f/60.0f) * 1000;
if(time < frameTime)
{
msleep(frameTime-time);
}
}
timer.start();
fbo_unbind();