diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/toon/anim.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/toon/anim.cpp')
-rw-r--r-- | engines/toon/anim.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index ec23fea186..4788ba61a9 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -150,10 +150,12 @@ void Animation::drawFrame(Graphics::Surface &surface, int32 frame, int16 xx, int if (_numFrames == 0) return; + int16 dataFrame = frame; + if (_frames[frame]._ref != -1) - frame = _frames[frame]._ref; + dataFrame = _frames[frame]._ref; - if (!_frames[frame]._data) + if (!_frames[dataFrame]._data) return; int16 rectX = _frames[frame]._x2 - _frames[frame]._x1; @@ -194,7 +196,7 @@ void Animation::drawFrame(Graphics::Surface &surface, int32 frame, int16 xx, int return; int32 destPitch = surface.pitch; - uint8 *srcRow = _frames[frame]._data + offsX + (_frames[frame]._x2 - _frames[frame]._x1) * offsY; + uint8 *srcRow = _frames[dataFrame]._data + offsX + (_frames[frame]._x2 - _frames[frame]._x1) * offsY; uint8 *curRow = (uint8 *)surface.getBasePtr(xx + _x1 + _frames[frame]._x1 + offsX, yy + _frames[frame]._y1 + _y1 + offsY); for (int16 y = 0; y < rectY; y++) { uint8 *cur = curRow; @@ -216,8 +218,12 @@ void Animation::drawFrameWithMask(Graphics::Surface &surface, int32 frame, int16 void Animation::drawFrameWithMaskAndScale(Graphics::Surface &surface, int32 frame, int16 xx, int16 yy, int32 zz, Picture *mask, int32 scale) { debugC(5, kDebugAnim, "drawFrameWithMaskAndScale(surface, %d, %d, %d, %d, mask, %d)", frame, xx, yy, zz, scale); + + int16 dataFrame = frame; + if (_frames[frame]._ref != -1) - frame = _frames[frame]._ref; + dataFrame = _frames[frame]._ref; + int16 rectX = _frames[frame]._x2 - _frames[frame]._x1; int16 rectY = _frames[frame]._y2 - _frames[frame]._y1; @@ -235,7 +241,7 @@ void Animation::drawFrameWithMaskAndScale(Graphics::Surface &surface, int32 fram int32 destPitch = surface.pitch; int32 destPitchMask = mask->getWidth(); - uint8 *c = _frames[frame]._data; + uint8 *c = _frames[dataFrame]._data; uint8 *curRow = (uint8 *)surface.getPixels(); uint8 *curRowMask = mask->getDataPtr(); @@ -287,9 +293,6 @@ int16 Animation::getFrameWidth(int32 frame) { if ((frame < 0) || (frame >= _numFrames)) return 0; - if (_frames[frame]._ref != -1) - frame = _frames[frame]._ref; - return _frames[frame]._x2 - _frames[frame]._x1; } @@ -298,9 +301,6 @@ int16 Animation::getFrameHeight(int32 frame) { if (frame < 0 || frame >= _numFrames) return 0; - if (_frames[frame]._ref != -1) - frame = _frames[frame]._ref; - return _frames[frame]._y2 - _frames[frame]._y1; } @@ -323,8 +323,10 @@ void Animation::drawFontFrame(Graphics::Surface &surface, int32 frame, int16 xx, if (_numFrames == 0) return; + int16 dataFrame = frame; + if (_frames[frame]._ref != -1) - frame = _frames[frame]._ref; + dataFrame = _frames[frame]._ref; int16 rectX = _frames[frame]._x2 - _frames[frame]._x1; int16 rectY = _frames[frame]._y2 - _frames[frame]._y1; @@ -345,7 +347,7 @@ void Animation::drawFontFrame(Graphics::Surface &surface, int32 frame, int16 xx, return; int32 destPitch = surface.pitch; - uint8 *c = _frames[frame]._data; + uint8 *c = _frames[dataFrame]._data; uint8 *curRow = (uint8 *)surface.getBasePtr(xx + _x1 + _frames[frame]._x1, yy + _frames[frame]._y1 + _y1); for (int16 y = 0; y < rectY; y++) { unsigned char *cur = curRow; |