diff options
author | Johannes Schickel | 2013-08-03 02:39:22 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-08-03 04:02:51 +0200 |
commit | 254dea1a35bedd8a9093680eafca9cdb780cb0f5 (patch) | |
tree | f59e2d86994e4e381ff07b142960c4a43150f780 /engines/groovie | |
parent | 63a2e47bfe2a0be8bc717a4274e94f78a98a9000 (diff) | |
download | scummvm-rg350-254dea1a35bedd8a9093680eafca9cdb780cb0f5.tar.gz scummvm-rg350-254dea1a35bedd8a9093680eafca9cdb780cb0f5.tar.bz2 scummvm-rg350-254dea1a35bedd8a9093680eafca9cdb780cb0f5.zip |
GROOVIE: Take advantage of Surface::getPixels.
Diffstat (limited to 'engines/groovie')
-rw-r--r-- | engines/groovie/graphics.cpp | 6 | ||||
-rw-r--r-- | engines/groovie/roq.cpp | 14 | ||||
-rw-r--r-- | engines/groovie/script.cpp | 4 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 14 |
4 files changed, 19 insertions, 19 deletions
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 73eb574dec..a4d8a4330c 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -82,8 +82,8 @@ void GraphicsMan::mergeFgAndBg() { uint32 i; byte *countf, *countb; - countf = (byte *)_foreground.getBasePtr(0, 0); - countb = (byte *)_background.getBasePtr(0, 0); + countf = (byte *)_foreground.getPixels(); + countb = (byte *)_background.getPixels(); for (i = 640 * 320; i; i--) { if (255 == *(countf)) { *(countf) = *(countb); @@ -94,7 +94,7 @@ void GraphicsMan::mergeFgAndBg() { } void GraphicsMan::updateScreen(Graphics::Surface *source) { - _vm->_system->copyRectToScreen(source->getBasePtr(0, 0), 640, 0, 80, 640, 320); + _vm->_system->copyRectToScreen(source->getPixels(), 640, 0, 80, 640, 320); change(); } diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 72a61fefb2..f9a938bfd4 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -160,7 +160,7 @@ bool ROQPlayer::playFrameInternal() { if (_dirty) { // Update the screen - _syst->copyRectToScreen(_bg->getBasePtr(0, 0), _bg->pitch, 0, (_syst->getHeight() - _bg->h) / 2, _bg->w, _bg->h); + _syst->copyRectToScreen(_bg->getPixels(), _bg->pitch, 0, (_syst->getHeight() - _bg->h) / 2, _bg->w, _bg->h); _syst->updateScreen(); // Clear the dirty flag @@ -291,8 +291,8 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { } // Clear the buffers with black YUV values - byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0); - byte *ptr2 = (byte *)_prevBuf->getBasePtr(0, 0); + byte *ptr1 = (byte *)_currBuf->getPixels(); + byte *ptr2 = (byte *)_prevBuf->getPixels(); for (int i = 0; i < width * height; i++) { *ptr1++ = 0; *ptr1++ = 128; @@ -436,11 +436,11 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder(); jpg->loadStream(*_file); - const byte *y = (const byte *)jpg->getComponent(1)->getBasePtr(0, 0); - const byte *u = (const byte *)jpg->getComponent(2)->getBasePtr(0, 0); - const byte *v = (const byte *)jpg->getComponent(3)->getBasePtr(0, 0); + const byte *y = (const byte *)jpg->getComponent(1)->getPixels(); + const byte *u = (const byte *)jpg->getComponent(2)->getPixels(); + const byte *v = (const byte *)jpg->getComponent(3)->getPixels(); - byte *ptr = (byte *)_currBuf->getBasePtr(0, 0); + byte *ptr = (byte *)_currBuf->getPixels(); for (int i = 0; i < _currBuf->w * _currBuf->h; i++) { *ptr++ = *y++; *ptr++ = *u++; diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index cbbdecc3e7..8e3bef9945 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -373,7 +373,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { rect.translate(0, -80); _vm->_graphicsMan->_foreground.frameRect(rect, 250); - _vm->_system->copyRectToScreen(_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); + _vm->_system->copyRectToScreen(_vm->_graphicsMan->_foreground.getPixels(), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); _vm->_system->updateScreen(); } @@ -983,7 +983,7 @@ void Script::o_strcmpnejmp_var() { // 0x21 void Script::o_copybgtofg() { // 0x22 debugScript(1, true, "COPY_BG_TO_FG"); - memcpy(_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_background.getBasePtr(0, 0), 640 * 320); + memcpy(_vm->_graphicsMan->_foreground.getPixels(), _vm->_graphicsMan->_background.getPixels(), 640 * 320); } void Script::o_strcmpeqjmp() { // 0x23 diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 8786e75488..59d966a22f 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -358,7 +358,7 @@ void VDXPlayer::getStill(Common::ReadStream *in) { byte *buf; if (_flagOne) { // Paint to the foreground - buf = (byte *)_fg->getBasePtr(0, 0); + buf = (byte *)_fg->getPixels(); if (_flag2Byte) { mask = 0xff; } else { @@ -370,7 +370,7 @@ void VDXPlayer::getStill(Common::ReadStream *in) { _flagFirstFrame = true; } else { // Paint to the background - buf = (byte *)_bg->getBasePtr(0, 0); + buf = (byte *)_bg->getPixels(); } // Read the palette @@ -486,9 +486,9 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth) // TODO: Verify just the else block is required //if (_flagOne) { // Paint to the foreground - //dest = (byte *)_fg->getBasePtr(0, 0) + offset; + //dest = (byte *)_fg->getPixels() + offset; //} else { - dest = (byte *)_bg->getBasePtr(0, 0) + offset; + dest = (byte *)_bg->getPixels() + offset; //} // Move the pointers to the beginning of the current block @@ -496,8 +496,8 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth) dest += blockOff; byte *fgBuf = 0; if (_flagSeven) { - fgBuf = (byte *)_fg->getBasePtr(0, 0) + offset + blockOff; - //byte *bgBuf = (byte *)_bg->getBasePtr(0, 0) + offset + blockOff; + fgBuf = (byte *)_fg->getPixels() + offset + blockOff; + //byte *bgBuf = (byte *)_bg->getPixels() + offset + blockOff; } for (int y = TILE_SIZE; y; y--) { @@ -550,7 +550,7 @@ void VDXPlayer::fadeIn(uint8 *targetpal) { // TODO: Is it required? If so, move to an appropiate place // Copy the foreground to the background - memcpy((byte *)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), (byte *)_vm->_graphicsMan->_background.getBasePtr(0, 0), 640 * 320); + memcpy((byte *)_vm->_graphicsMan->_foreground.getPixels(), (byte *)_vm->_graphicsMan->_background.getPixels(), 640 * 320); // Start a fadein _vm->_graphicsMan->fadeIn(targetpal); |