diff options
author | Matthew Hoops | 2012-06-16 01:37:40 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-06-16 01:43:32 -0400 |
commit | 625f6cc71657e95e0361edefa333a38910c1aca5 (patch) | |
tree | ae5ef8582ede4d62e56253467ea144db2341b353 /engines/toon/anim.cpp | |
parent | f02b696573fe4281e4890d71b74671804a5ebf41 (diff) | |
parent | 5230a0d61795e2855625a43d60dc3bc2ed83fc3d (diff) | |
download | scummvm-rg350-625f6cc71657e95e0361edefa333a38910c1aca5.tar.gz scummvm-rg350-625f6cc71657e95e0361edefa333a38910c1aca5.tar.bz2 scummvm-rg350-625f6cc71657e95e0361edefa333a38910c1aca5.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/toon/anim.cpp')
-rw-r--r-- | engines/toon/anim.cpp | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 98c667c303..84f6fa375c 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -229,37 +229,26 @@ void Animation::drawFrameWithMaskAndScale(Graphics::Surface &surface, int32 fram uint8 *curRow = (uint8 *)surface.pixels; uint8 *curRowMask = mask->getDataPtr(); - if (strstr(_name, "SHADOW")) { - for (int y = yy1; y < yy2; y++) { - for (int x = xx1; x < xx2; x++) { - if (x < 0 || x >= 1280 || y < 0 || y >= 400) - continue; - - uint8 *cur = curRow + x + y * destPitch; - uint8 *curMask = curRowMask + x + y * destPitchMask; - - // find the good c - int32 xs = (x - xx1) * 1024 / scale; - int32 ys = (y - yy1) * 1024 / scale; - uint8 *cc = &c[ys * w + xs]; - if (*cc && ((*curMask) >= zz)) + bool shadowFlag = false; + if (strstr(_name, "SHADOW")) + shadowFlag = true; + + for (int32 y = yy1; y < yy2; y++) { + for (int32 x = xx1; x < xx2; x++) { + if (x < 0 || x >= 1280 || y < 0 || y >= 400) + continue; + + uint8 *cur = curRow + x + y * destPitch; + uint8 *curMask = curRowMask + x + y * destPitchMask; + + // find the good c + int32 xs = (x - xx1) * 1024 / scale; + int32 ys = (y - yy1) * 1024 / scale; + uint8 *cc = &c[ys * w + xs]; + if (*cc && ((*curMask) >= zz)) { + if (shadowFlag) *cur = _vm->getShadowLUT()[*cur]; - } - } - } else { - for (int y = yy1; y < yy2; y++) { - for (int x = xx1; x < xx2; x++) { - if (x < 0 || x >= 1280 || y < 0 || y >= 400) - continue; - - uint8 *cur = curRow + x + y * destPitch; - uint8 *curMask = curRowMask + x + y * destPitchMask; - - // find the good c - int32 xs = (x - xx1) * 1024 / scale; - int32 ys = (y - yy1) * 1024 / scale; - uint8 *cc = &c[ys * w + xs]; - if (*cc && ((*curMask) >= zz)) + else *cur = *cc; } } |