diff options
author | johndoe123 | 2012-10-14 10:28:44 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:47:07 +0200 |
commit | a724e603dace28b1fc4d1f9036849c119712c93a (patch) | |
tree | 29dc6de7e460af111ed752956e4b93709d554116 /engines/neverhood/neverhood.cpp | |
parent | fa53c0cf8350a873a3278c5debaee1562f51e15b (diff) | |
download | scummvm-rg350-a724e603dace28b1fc4d1f9036849c119712c93a.tar.gz scummvm-rg350-a724e603dace28b1fc4d1f9036849c119712c93a.tar.bz2 scummvm-rg350-a724e603dace28b1fc4d1f9036849c119712c93a.zip |
NEVERHOOD: Use CursorMan
- Only update entities according to the current frame rate but run the actual game loop at a faster rate so the mouse cursor movement doesn't get choppy
Diffstat (limited to 'engines/neverhood/neverhood.cpp')
-rw-r--r-- | engines/neverhood/neverhood.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index 72fa3601ed..5152def96a 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -106,6 +106,8 @@ Common::Error NeverhoodEngine::run() { _gameModule = new GameModule(this); _gameModule->startup(); + + uint32 nextFrameTime = 0; // Preliminary main loop, needs some more work but works for testing while (!shouldQuit()) { @@ -148,13 +150,16 @@ Common::Error NeverhoodEngine::run() { } } - //debug("millis %d", _system->getMillis()); - _gameModule->handleUpdate(); - _gameModule->draw(); + if (_system->getMillis() >= nextFrameTime) { + _gameModule->handleUpdate(); + _gameModule->draw(); + nextFrameTime = _screen->getNextFrameTime(); + }; + _soundMan->update(); _audioResourceMan->update(); - _screen->wait(); _screen->update(); + _system->delayMillis(10); debug(0, "---------------------------------------"); |