diff options
-rw-r--r-- | engines/sci/graphics/controls32.cpp | 3 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 6aad636e7e..4cbb4541df 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -310,8 +310,7 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) { g_sci->_gfxFrameout->frameOut(true); g_sci->getSciDebugger()->onFrame(); - g_sci->getEngineState()->speedThrottler(16); - g_sci->getEngineState()->_throttleTrigger = true; + g_sci->_gfxFrameout->throttle(); } g_sci->_gfxFrameout->deletePlane(*plane); diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 50f26474f1..c0feea8999 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1567,6 +1567,10 @@ void GfxFrameout::kernelFrameOut(const bool shouldShowBits) { frameOut(shouldShowBits); } + throttle(); +} + +void GfxFrameout::throttle() { if (_throttleFrameOut) { uint8 throttleTime; if (_throttleState == 2) { diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 05c48c3485..cc62c61d22 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -185,7 +185,7 @@ private: /** * Whether or not calls to kFrameOut should be framerate - * limited to ~60fps. + * limited to 60fps. */ bool _throttleFrameOut; @@ -438,6 +438,12 @@ public: void kernelFrameOut(const bool showBits); /** + * Throttles the engine as necessary to maintain + * 60fps output. + */ + void throttle(); + + /** * Updates the internal screen buffer for the next * frame. If `shouldShowBits` is true, also sends the * buffer to hardware. If `eraseRect` is non-empty, |