diff options
author | Paul Gilbert | 2015-02-08 22:07:42 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-08 22:07:42 -0500 |
commit | 5e00b39caec66e1c5626a89f207c26c577fd30d8 (patch) | |
tree | d8d81eb6a19754c031fd603b4f6af5810fd38878 /engines/mads/msurface.cpp | |
parent | cbbd1a92192ad118897f645f1aa6e968bff01466 (diff) | |
download | scummvm-rg350-5e00b39caec66e1c5626a89f207c26c577fd30d8.tar.gz scummvm-rg350-5e00b39caec66e1c5626a89f207c26c577fd30d8.tar.bz2 scummvm-rg350-5e00b39caec66e1c5626a89f207c26c577fd30d8.zip |
MADS: Implementing code for panning screen transitions
Diffstat (limited to 'engines/mads/msurface.cpp')
-rw-r--r-- | engines/mads/msurface.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 39824bac4b..d8d01f307c 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -485,7 +485,6 @@ void MSurface::scrollY(int yAmount) { delete[] tempData; } - void MSurface::translate(Common::Array<RGB6> &palette) { for (int y = 0; y < this->h; ++y) { byte *pDest = getBasePtr(0, y); @@ -521,6 +520,20 @@ MSurface *MSurface::flipHorizontal() const { return dest; } +void MSurface::copyRectTranslate(MSurface &srcSurface, const byte *paletteMap, + const Common::Point &destPos, const Common::Rect &srcRect) { + // Loop through the lines + for (int yCtr = 0; yCtr < srcRect.height(); ++yCtr) { + const byte *srcP = srcSurface.getBasePtr(srcRect.left, srcRect.top + yCtr); + byte *destP = getBasePtr(destPos.x, destPos.y + yCtr); + + // Copy the line over + for (int xCtr = 0; xCtr < srcRect.width(); ++xCtr, ++srcP, ++destP) { + *destP = paletteMap[*srcP]; + } + } +} + /*------------------------------------------------------------------------*/ int DepthSurface::getDepth(const Common::Point &pt) { |