diff options
author | Colin Snover | 2016-07-01 19:47:15 -0500 |
---|---|---|
committer | Colin Snover | 2016-07-02 22:28:47 -0500 |
commit | a4c059b8641e8fe170ac1f829e56a4d0e98fa455 (patch) | |
tree | aea95bdd0a0e5c4d78bf753e6aee6fd66c5557e5 /engines/sci | |
parent | 77991b7eac85051978bf1c09dd4d0710ac3929ef (diff) | |
download | scummvm-rg350-a4c059b8641e8fe170ac1f829e56a4d0e98fa455.tar.gz scummvm-rg350-a4c059b8641e8fe170ac1f829e56a4d0e98fa455.tar.bz2 scummvm-rg350-a4c059b8641e8fe170ac1f829e56a4d0e98fa455.zip |
SCI32: Improve accuracy of frameout throttler
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 6 |
2 files changed, 17 insertions, 1 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 140c27a6d7..50f26474f1 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -76,6 +76,7 @@ GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAd _benchmarkingFinished(false), _throttleFrameOut(true), _showStyles(nullptr), + _throttleState(0), // TODO: Stop using _gfxScreen _currentBuffer(screen->getDisplayWidth(), screen->getDisplayHeight(), nullptr), _remapOccurred(false), @@ -1567,7 +1568,16 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) { } if (_throttleFrameOut) { - g_sci->getEngineState()->speedThrottler(16); + uint8 throttleTime; + if (_throttleState == 2) { + throttleTime = 17; + _throttleState = 0; + } else { + throttleTime = 16; + ++_throttleState; + } + + g_sci->getEngineState()->speedThrottler(throttleTime); g_sci->getEngineState()->_throttleTrigger = true; } } diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 4a44410334..d349bbe66f 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -304,6 +304,12 @@ public: #pragma mark Rendering private: /** + * State tracker to provide more accurate 60fps + * video throttling. + */ + uint8 _throttleState; + + /** * TODO: Documentation */ int8 _styleRanges[256]; |