From 7455cd4e35cb8d65e9adef86062f0566bc96e4ba Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 Aug 2013 02:44:15 +0200 Subject: [PATCH] TOON: Take advantage of Surface::getPixels. --- engines/toon/anim.cpp | 2 +- engines/toon/movie.cpp | 2 +- engines/toon/toon.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index aecf341079af..78d3954325f9 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -231,7 +231,7 @@ void Animation::drawFrameWithMaskAndScale(Graphics::Surface &surface, int32 fram int32 destPitch = surface.pitch; int32 destPitchMask = mask->getWidth(); uint8 *c = _frames[frame]._data; - uint8 *curRow = (uint8 *)surface.getBasePtr(0, 0); + uint8 *curRow = (uint8 *)surface.getPixels(); uint8 *curRowMask = mask->getDataPtr(); bool shadowFlag = false; diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index 962b73dfa737..f0463a52e1a4 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -112,7 +112,7 @@ bool Movie::playVideo(bool isFirstIntroVideo) { } _vm->_system->unlockScreen(); } else { - _vm->_system->copyRectToScreen(frame->getBasePtr(0, 0), frame->pitch, 0, 0, frame->w, frame->h); + _vm->_system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h); // WORKAROUND: There is an encoding glitch in the first intro video. This hides this using the adjacent pixels. if (isFirstIntroVideo) { diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 2f5c810811f1..286bcf19418e 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -499,7 +499,7 @@ void ToonEngine::copyToVirtualScreen(bool updateScreen) { if (_dirtyAll || _gameState->_currentScrollValue != lastScroll) { // we have to refresh everything in case of scrolling. - _system->copyRectToScreen((byte *)_mainSurface->getBasePtr(0, 0) + state()->_currentScrollValue, TOON_BACKBUFFER_WIDTH, 0, 0, TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT); + _system->copyRectToScreen((byte *)_mainSurface->getPixels() + state()->_currentScrollValue, TOON_BACKBUFFER_WIDTH, 0, 0, TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT); } else { int32 offX = 0;