aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRichieSams2013-09-16 00:00:52 -0500
committerRichieSams2013-09-16 00:00:52 -0500
commit41afb2dd90caa5dc09a688d253c119e28ef25318 (patch)
tree3c339e8b47aaa59342464a58801fc471f24d3147 /engines
parent2b2f85063afd2fcd5d7b24851ad697de58e9c8a6 (diff)
downloadscummvm-rg350-41afb2dd90caa5dc09a688d253c119e28ef25318.tar.gz
scummvm-rg350-41afb2dd90caa5dc09a688d253c119e28ef25318.tar.bz2
scummvm-rg350-41afb2dd90caa5dc09a688d253c119e28ef25318.zip
ZVISION: Move clearing dirty rects to after they are blitted instead the beginning of each frame
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/render_manager.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 1c1ce40c6c..a5c659d115 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -60,10 +60,6 @@ RenderManager::~RenderManager() {
}
void RenderManager::update(uint deltaTimeInMillis) {
- // Clear the dirty rects from last frame
- _workingWindowDirtyRect = Common::Rect();
- _backBufferDirtyRect = Common::Rect();
-
// An inverse velocity of 0 would be infinitely fast, so we'll let 0 mean no velocity.
if (_backgroundInverseVelocity != 0) {
_accumulatedVelocityMilliseconds += deltaTimeInMillis;
@@ -93,7 +89,14 @@ void RenderManager::renderBackbufferToScreen() {
// Translate the working window dirty rect to screen coords
_workingWindowDirtyRect.translate(_workingWindow.left, _workingWindow.top);
// Then extend the backbuffer dirty rect to contain it
- _backBufferDirtyRect.extend(_workingWindowDirtyRect);
+ if (_backBufferDirtyRect.isEmpty()) {
+ _backBufferDirtyRect = _workingWindowDirtyRect;
+ } else {
+ _backBufferDirtyRect.extend(_workingWindowDirtyRect);
+ }
+
+ // Clear the dirty rect
+ _workingWindowDirtyRect = Common::Rect();
}
// TODO: Add menu rendering
@@ -103,6 +106,7 @@ void RenderManager::renderBackbufferToScreen() {
if (!_backBufferDirtyRect.isEmpty()) {
_system->copyRectToScreen(_backBuffer.getBasePtr(_backBufferDirtyRect.left, _backBufferDirtyRect.top), _backBuffer.pitch, _backBufferDirtyRect.left, _backBufferDirtyRect.top, _backBufferDirtyRect.width(), _backBufferDirtyRect.height());
+ _backBufferDirtyRect = Common::Rect();
}
}