diff options
author | Paul Gilbert | 2014-03-13 22:25:16 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-03-13 22:25:16 -0400 |
commit | 3f0cd4771c94a83c72f09f74ba351a3905357d1c (patch) | |
tree | 5bc2e37b658b01403a5cb59337094719f7e3192a /engines/mads/scene_data.cpp | |
parent | 84fb90e7a52daffd862159d54cda4817aa930a6f (diff) | |
download | scummvm-rg350-3f0cd4771c94a83c72f09f74ba351a3905357d1c.tar.gz scummvm-rg350-3f0cd4771c94a83c72f09f74ba351a3905357d1c.tar.bz2 scummvm-rg350-3f0cd4771c94a83c72f09f74ba351a3905357d1c.zip |
MADS: Fixed handling of dirty rects to copy areas to the physical screen
Diffstat (limited to 'engines/mads/scene_data.cpp')
-rw-r--r-- | engines/mads/scene_data.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index 8f981ef37d..fe768934c3 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -24,7 +24,7 @@ #include "mads/scene_data.h" #include "mads/mads.h" #include "mads/compression.h" -#include "mads/graphics.h" +#include "mads/screen.h" #include "mads/resources.h" #include "mads/nebular/nebular_scenes.h" @@ -276,7 +276,20 @@ void DirtyAreas::mergeAreas(int idx1, int idx2) { da1._textActive = true; } -void DirtyAreas::copy(MSurface *dest, MSurface *src, const Common::Point &posAdjust) { +void DirtyAreas::copy(MSurface *srcSurface, MSurface *destSurface, const Common::Point &posAdjust) { + for (uint i = 0; i < size(); ++i) { + const Common::Rect &srcBounds = (*this)[i]._bounds; + + Common::Rect bounds(srcBounds.left + posAdjust.x, srcBounds.top + posAdjust.y, + srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y); + + if ((*this)[i]._active && bounds.isValidRect()) { + srcSurface->copyTo(destSurface, bounds, Common::Point(bounds.left, bounds.top)); + } + } +} + +void DirtyAreas::copyToScreen(const Common::Point &posAdjust) { for (uint i = 0; i < size(); ++i) { const Common::Rect &srcBounds = (*this)[i]._bounds; @@ -284,8 +297,7 @@ void DirtyAreas::copy(MSurface *dest, MSurface *src, const Common::Point &posAdj srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y); if ((*this)[i]._active && (*this)[i]._bounds.isValidRect()) { - src->copyTo(dest, bounds, Common::Point((*this)[i]._bounds.left, - (*this)[i]._bounds.top)); + _vm->_screen.copyRectToScreen(bounds); } } } |