Skip to content

Commit

Permalink
TOON: Take advantage of Surface::getPixels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Aug 3, 2013
1 parent b125aa9 commit 7455cd4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engines/toon/anim.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/toon/movie.cpp
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion engines/toon/toon.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 7455cd4

Please sign in to comment.