diff options
author | Paul Gilbert | 2010-06-13 10:50:54 +0000 |
---|---|---|
committer | Paul Gilbert | 2010-06-13 10:50:54 +0000 |
commit | 4c6d276ce914cafc170732fb7203145c8a763b37 (patch) | |
tree | 13b246a31575ae165289681ea40ab188b59d2e02 /engines/m4/mads_views.cpp | |
parent | 466479eb77dfd04c7116f97f93e2f8013442307b (diff) | |
download | scummvm-rg350-4c6d276ce914cafc170732fb7203145c8a763b37.tar.gz scummvm-rg350-4c6d276ce914cafc170732fb7203145c8a763b37.tar.bz2 scummvm-rg350-4c6d276ce914cafc170732fb7203145c8a763b37.zip |
Bugfixes for correct moving of the screen viewport within an animation
svn-id: r49629
Diffstat (limited to 'engines/m4/mads_views.cpp')
-rw-r--r-- | engines/m4/mads_views.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index 98b04e9f2d..178fd90fd3 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -855,10 +855,15 @@ void MadsDirtyAreas::mergeAreas(int idx1, int idx2) { da1.textActive = true; } -void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset) { +void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset, const Common::Point &posAdjust) { for (uint i = 0; i < _entries.size(); ++i) { + const Common::Rect &srcBounds = _entries[i].bounds; + + Common::Rect bounds(srcBounds.left + posAdjust.x, srcBounds.top + posAdjust.y, + srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y); + if (_entries[i].active && _entries[i].bounds.isValidRect()) - src->copyTo(dest, _entries[i].bounds, _entries[i].bounds.left, _entries[i].bounds.top + yOffset); + src->copyTo(dest, bounds, _entries[i].bounds.left, _entries[i].bounds.top + yOffset); } } @@ -1202,7 +1207,7 @@ void MadsView::refresh() { _dirtyAreas.merge(1, DIRTY_AREAS_SIZE); // Copy dirty areas to the main display surface - _dirtyAreas.copy(_view, _bgSurface, _yOffset); + _dirtyAreas.copy(_view, _bgSurface, _yOffset, _posAdjust); // Handle dirty areas for foreground objects _spriteSlots.setDirtyAreas(); |