aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/frameout.h
diff options
context:
space:
mode:
authorColin Snover2017-05-22 18:40:52 -0500
committerColin Snover2017-07-06 19:12:35 -0500
commit9f910535c9d358262b68ad9200e041a9a6d77ce5 (patch)
treebe3978b8f042caa7087c0b04d27d7f2187da297e /engines/sci/graphics/frameout.h
parentf40ea8c2e7380b512042ab171be45eec19962b8f (diff)
downloadscummvm-rg350-9f910535c9d358262b68ad9200e041a9a6d77ce5.tar.gz
scummvm-rg350-9f910535c9d358262b68ad9200e041a9a6d77ce5.tar.bz2
scummvm-rg350-9f910535c9d358262b68ad9200e041a9a6d77ce5.zip
SCI32: Centralise OSystem screen updates
Diffstat (limited to 'engines/sci/graphics/frameout.h')
-rw-r--r--engines/sci/graphics/frameout.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index e706f141b2..ab58f41144 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -155,6 +155,11 @@ public:
#pragma mark -
#pragma mark Rendering
private:
+ /**
+ * The last time the hardware screen was updated.
+ */
+ uint32 _lastScreenUpdateTick;
+
GfxTransitions32 *_transitions;
/**
@@ -255,8 +260,8 @@ private:
void mergeToShowList(const Common::Rect &drawRect, RectList &showList, const int overdrawThreshold);
/**
- * Writes the internal frame buffer out to hardware and
- * clears the show list.
+ * Sends all dirty rects from the internal frame buffer to the backend,
+ * then updates the hardware screen.
*/
void showBits();
@@ -285,6 +290,18 @@ private:
}
public:
+ /**
+ * Updates the hardware screen, no more than once per tick.
+ *
+ * @param delta An additional number of ticks that should elapse
+ * since the last time the screen was updated before it gets updated now.
+ * This is used for updating the screen within run_vm, where we normally
+ * expect that a call to kFrameOut will occur later during the current
+ * frame, but if it does not, then update the screen on the second frame
+ * anyway since the game is doing something bad.
+ */
+ void updateScreen(const int delta = 0);
+
void setPixelFormat(const Graphics::PixelFormat &format) const {
initGraphics(_currentBuffer.screenWidth, _currentBuffer.screenHeight, _isHiRes, &format);
}