[Scummvm-git-logs] scummvm master -> 7acd288e365c352602feff3cd03b610ddbe76603
sev-
sev at scummvm.org
Sat Aug 27 12:33:45 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ea7076028b DIRECTOR: Implemented Transparent Ink
7acd288e36 DIRECTOR: Optimized Matte Ink drawing
Commit: ea7076028b0382bf88b5f7f447f23e0bc7e28f7f
https://github.com/scummvm/scummvm/commit/ea7076028b0382bf88b5f7f447f23e0bc7e28f7f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-27T12:10:56+02:00
Commit Message:
DIRECTOR: Implemented Transparent Ink
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index bca54ef..f88eb82 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -471,6 +471,10 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
case kInkTypeCopy:
surface.blitFrom(*img->getSurface(), Common::Point(x, y));
break;
+ case kInkTypeTransparent:
+ //FIXME: is it always white (last entry in pallette)?
+ surface.transBlitFrom(*img->getSurface(), Common::Point(x, y), _vm->getPaletteColorCount() - 1);
+ break;
case kInkTypeBackgndTrans:
drawBackgndTransSprite(surface, *img->getSurface(), drawRect);
break;
@@ -708,7 +712,7 @@ void Frame::drawReverseSprite(Graphics::ManagedSurface &target, const Graphics::
}
void Frame::drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) {
- //Like background trans, but all white pixels NOT ENCLOSED by coloured pixels are transparent
+ // Like background trans, but all white pixels NOT ENCLOSED by coloured pixels are transparent
Graphics::Surface tmp;
tmp.copyFrom(sprite);
Commit: 7acd288e365c352602feff3cd03b610ddbe76603
https://github.com/scummvm/scummvm/commit/7acd288e365c352602feff3cd03b610ddbe76603
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-27T12:15:00+02:00
Commit Message:
DIRECTOR: Optimized Matte Ink drawing
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index f88eb82..3d5d8b6 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -734,31 +734,38 @@ void Frame::drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Su
}
if (whiteColor == -1) {
- warning("No white color for Matte image");
- whiteColor = *(byte *)tmp.getBasePtr(0, 0);
- }
+ debugC(1, kDebugImages, "No white color for Matte image");
- Graphics::FloodFill ff(&tmp, whiteColor, 0, true);
+ for (int yy = 0; yy < tmp.h; yy++) {
+ const byte *src = (const byte *)tmp.getBasePtr(0, yy);
+ byte *dst = (byte *)target.getBasePtr(drawRect.left, drawRect.top + yy);
- for (int yy = 0; yy < tmp.h; yy++) {
- ff.addSeed(0, yy);
- ff.addSeed(tmp.w - 1, yy);
- }
+ for (int xx = 0; xx < drawRect.width(); xx++, src++, dst++)
+ *dst = *src;
+ }
+ } else {
+ Graphics::FloodFill ff(&tmp, whiteColor, 0, true);
- for (int xx = 0; xx < tmp.w; xx++) {
- ff.addSeed(xx, 0);
- ff.addSeed(xx, tmp.h - 1);
- }
- ff.fillMask();
+ for (int yy = 0; yy < tmp.h; yy++) {
+ ff.addSeed(0, yy);
+ ff.addSeed(tmp.w - 1, yy);
+ }
- for (int yy = 0; yy < tmp.h; yy++) {
- const byte *src = (const byte *)tmp.getBasePtr(0, yy);
- const byte *mask = (const byte *)ff.getMask()->getBasePtr(0, yy);
- byte *dst = (byte *)target.getBasePtr(drawRect.left, drawRect.top + yy);
+ for (int xx = 0; xx < tmp.w; xx++) {
+ ff.addSeed(xx, 0);
+ ff.addSeed(xx, tmp.h - 1);
+ }
+ ff.fillMask();
- for (int xx = 0; xx < drawRect.width(); xx++, src++, dst++, mask++)
- if (*mask == 0)
- *dst = *src;
+ for (int yy = 0; yy < tmp.h; yy++) {
+ const byte *src = (const byte *)tmp.getBasePtr(0, yy);
+ const byte *mask = (const byte *)ff.getMask()->getBasePtr(0, yy);
+ byte *dst = (byte *)target.getBasePtr(drawRect.left, drawRect.top + yy);
+
+ for (int xx = 0; xx < drawRect.width(); xx++, src++, dst++, mask++)
+ if (*mask == 0)
+ *dst = *src;
+ }
}
tmp.free();
More information about the Scummvm-git-logs
mailing list