diff options
author | Johannes Schickel | 2013-08-03 02:39:37 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-08-03 04:02:51 +0200 |
commit | cad9148f851df68e030dfa858b5cdd56d3b2a4ac (patch) | |
tree | ed4075bd1263737c064af2b85745a49afda24799 | |
parent | 254dea1a35bedd8a9093680eafca9cdb780cb0f5 (diff) | |
download | scummvm-rg350-cad9148f851df68e030dfa858b5cdd56d3b2a4ac.tar.gz scummvm-rg350-cad9148f851df68e030dfa858b5cdd56d3b2a4ac.tar.bz2 scummvm-rg350-cad9148f851df68e030dfa858b5cdd56d3b2a4ac.zip |
HOPKINS: Take advantage of Surface::getPixels.
-rw-r--r-- | engines/hopkins/dialogs.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 4 | ||||
-rw-r--r-- | engines/hopkins/saveload.cpp | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 32b8cd8256..3b8fedf0ee 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -691,7 +691,7 @@ void DialogsManager::showSaveLoad(SaveLoadMode mode) { Graphics::Surface thumb8; _vm->_saveLoad->convertThumb16To8(header._thumbnail, &thumb8); - byte *thumb = (byte *)thumb8.getBasePtr(0, 0); + byte *thumb = (byte *)thumb8.getPixels(); int16 startPosX_ = _vm->_events->_startPos.x; switch (slotNumber) { diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 7fe9943dbb..66ddbfaae6 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -325,7 +325,7 @@ void GraphicsManager::loadPCX640(byte *surface, const Common::String &file, byte // Copy out the dimensions and pixels of the decoded surface _largeScreenFl = s->w > SCREEN_WIDTH; - Common::copy((const byte *)s->getBasePtr(0, 0), (const byte *)s->getBasePtr(0, s->h), surface); + Common::copy((const byte *)s->getPixels(), (const byte *)s->getBasePtr(0, s->h), surface); // Copy out the palette const byte *palSrc = pcxDecoder.getPalette(); @@ -1202,7 +1202,7 @@ void GraphicsManager::displayZones() { void GraphicsManager::displayLines() { Graphics::Surface *screenSurface = g_system->lockScreen(); - uint16 *pixels = (uint16 *)screenSurface->getBasePtr(0, 0); + uint16 *pixels = (uint16 *)screenSurface->getPixels(); for (int lineIndex = 0; lineIndex < _vm->_linesMan->_linesNumb; lineIndex++) { int i = 0; diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp index 3a1f596c52..b0dea7e6d1 100644 --- a/engines/hopkins/saveload.cpp +++ b/engines/hopkins/saveload.cpp @@ -233,14 +233,14 @@ void SaveLoadManager::createThumbnail(Graphics::Surface *s) { Graphics::Surface thumb8; thumb8.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); - _vm->_graphicsMan->reduceScreenPart(_vm->_graphicsMan->_frontBuffer, (byte *)thumb8.getBasePtr(0, 0), + _vm->_graphicsMan->reduceScreenPart(_vm->_graphicsMan->_frontBuffer, (byte *)thumb8.getPixels(), _vm->_events->_startPos.x, 20, SCREEN_WIDTH, SCREEN_HEIGHT - 40, 80); // Convert the 8-bit pixel to 16 bit surface s->create(w, h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); - const byte *srcP = (const byte *)thumb8.getBasePtr(0, 0); - uint16 *destP = (uint16 *)s->getBasePtr(0, 0); + const byte *srcP = (const byte *)thumb8.getPixels(); + uint16 *destP = (uint16 *)s->getPixels(); for (int yp = 0; yp < h; ++yp) { // Copy over the line, using the source pixels as lookups into the pixels palette @@ -299,8 +299,8 @@ void SaveLoadManager::convertThumb16To8(Graphics::Surface *thumb16, Graphics::Su pixelFormat16.colorToRGB(p, paletteR[palIndex], paletteG[palIndex], paletteB[palIndex]); } - const uint16 *srcP = (const uint16 *)thumb16->getBasePtr(0, 0); - byte *destP = (byte *)thumb8->getBasePtr(0, 0); + const uint16 *srcP = (const uint16 *)thumb16->getPixels(); + byte *destP = (byte *)thumb8->getPixels(); for (int yp = 0; yp < thumb16->h; ++yp) { const uint16 *lineSrcP = srcP; |