[Scummvm-cvs-logs] scummvm master -> c668431522d834b24c00baf964d2b6b3f3a2bbb8
digitall
digitall at scummvm.org
Fri Jun 15 13:12:59 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c668431522 TOON: Simplify code in Animation::drawFrameWithMaskAndScale().
Commit: c668431522d834b24c00baf964d2b6b3f3a2bbb8
https://github.com/scummvm/scummvm/commit/c668431522d834b24c00baf964d2b6b3f3a2bbb8
Author: D G Turner (digitall at scummvm.org)
Date: 2012-06-15T04:11:01-07:00
Commit Message:
TOON: Simplify code in Animation::drawFrameWithMaskAndScale().
Changed paths:
engines/toon/anim.cpp
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 98c667c..84f6fa3 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;
}
}
More information about the Scummvm-git-logs
mailing list