diff options
author | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
---|---|---|
committer | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
commit | 7f8308e0eb50c4e13ec0684619b5474983a93a66 (patch) | |
tree | 0a057f01385a11d99add1e294f70891a8e8bf6c9 /engines/mortevielle | |
parent | 6e9390feb8166d5f9d6c6fdfe00a336b4f71de4c (diff) | |
parent | e5f0c42a65f38611272542a144228753e0496493 (diff) | |
download | scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.gz scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.bz2 scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.zip |
Merge pull request #365 from lordhoto/protected-pixels
Make Graphics::Surface::pixels protected.
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/graphics.cpp | 9 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/saveload.cpp | 2 |
3 files changed, 4 insertions, 9 deletions
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index c066114e8d..059f5a9be8 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -897,12 +897,7 @@ Graphics::Surface ScreenSurface::lockArea(const Common::Rect &bounds) { _dirtyRects.push_back(bounds); Graphics::Surface s; - s.format = format; - s.pixels = getBasePtr(bounds.left, bounds.top); - s.pitch = pitch; - s.w = bounds.width(); - s.h = bounds.height(); - + s.init(bounds.width(), bounds.height(), pitch, getBasePtr(bounds.left, bounds.top), format); return s; } @@ -1067,7 +1062,7 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) { assert((pt.x >= 0) && (pt.y >= 0) && (pt.x <= SCREEN_WIDTH) && (pt.y <= SCREEN_ORIG_HEIGHT)); Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, pt.x + 1, (pt.y + 1) * 2)); - byte *destP = (byte *)destSurface.pixels; + byte *destP = (byte *)destSurface.getPixels(); *destP = palIndex; *(destP + SCREEN_WIDTH) = palIndex; } diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index aa8d67e98a..f32c551ddb 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -393,7 +393,7 @@ void Menu::menuUp(int msgId) { // Get a pointer to the source and destination of the area to restore const byte *pSrc = (const byte *)_vm->_backgroundSurface.getBasePtr(0, 10); Graphics::Surface destArea = _vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT)); - byte *pDest = (byte *)destArea.getBasePtr(0, 0); + byte *pDest = (byte *)destArea.getPixels(); // Copy the data Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest); diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp index 77c242c9e7..651ed07b65 100644 --- a/engines/mortevielle/saveload.cpp +++ b/engines/mortevielle/saveload.cpp @@ -189,7 +189,7 @@ void SavegameManager::writeSavegameHeader(Common::OutSaveFile *out, const Common Graphics::Surface *thumb = new Graphics::Surface(); Graphics::Surface s = g_vm->_screenSurface.lockArea(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - ::createThumbnail(thumb, (const byte *)s.pixels, SCREEN_WIDTH, SCREEN_HEIGHT, thumbPalette); + ::createThumbnail(thumb, (const byte *)s.getPixels(), SCREEN_WIDTH, SCREEN_HEIGHT, thumbPalette); Graphics::saveThumbnail(*out, *thumb); thumb->free(); delete thumb; |