diff options
author | Travis Howell | 2006-03-13 06:06:51 +0000 |
---|---|---|
committer | Travis Howell | 2006-03-13 06:06:51 +0000 |
commit | 06dddefe90c239f02fb98464a64970c2a5a4c66d (patch) | |
tree | ed3d63b6103d476d6a2a796c3c58cb810d81efcc | |
parent | 833e3430598f6de8d854b39a663fc75152275d8c (diff) | |
download | scummvm-rg350-06dddefe90c239f02fb98464a64970c2a5a4c66d.tar.gz scummvm-rg350-06dddefe90c239f02fb98464a64970c2a5a4c66d.tar.bz2 scummvm-rg350-06dddefe90c239f02fb98464a64970c2a5a4c66d.zip |
Add masking support for C64 maniac, not perfect
svn-id: r21250
-rw-r--r-- | engines/scumm/boxes.cpp | 9 | ||||
-rw-r--r-- | engines/scumm/costume.cpp | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 65b6ebd75c..e3c4d7fe10 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -42,7 +42,7 @@ struct Box { /* Internal walkbox file format */ byte x2; byte y1; byte y2; - byte flags; + byte mask; } GCC_PACK c64; struct { @@ -111,8 +111,7 @@ byte ScummEngine::getMaskFromBox(int box) { if (_game.version == 8) return (byte) FROM_LE_32(ptr->v8.mask); else if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) - // No mask? - return 0; + return ptr->c64.mask; else if (_game.version <= 2) return ptr->v2.mask; else @@ -132,8 +131,6 @@ void ScummEngine::setBoxFlags(int box, int val) { return; if (_game.version == 8) ptr->v8.flags = TO_LE_32(val); - else if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) - ptr->c64.flags = val; else if (_game.version <= 2) ptr->v2.flags = val; else @@ -148,7 +145,7 @@ byte ScummEngine::getBoxFlags(int box) { if (_game.version == 8) return (byte) FROM_LE_32(ptr->v8.flags); else if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) - return ptr->c64.flags; + return 0; else if (_game.version <= 2) return ptr->v2.flags; else diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index af08f333a8..3b893bde15 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -981,11 +981,15 @@ static const byte actorColorsMMC64[25] = { 0, 7, 2, 6, 9, 1, 3, 7, 7, 1, 1, 9, 1, 4, 5, 5, 4, 1, 0, 5, 4, 2, 2, 7, 7 }; +#define MASK_AT(xoff) \ + (mask && (mask[((destX + xoff) / 8)] & revBitMask((destX + xoff) & 7))) #define LINE(c,p) \ pcolor = (color >> c) & 3; \ if (pcolor) { \ - dst[p] = palette[pcolor]; \ - dst[p + 1] = palette[pcolor]; \ + if (!MASK_AT(p)) \ + dst[p] = palette[pcolor]; \ + if (!MASK_AT(p + 1)) \ + dst[p + 1] = palette[pcolor]; \ } byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { @@ -1074,7 +1078,8 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { int destY = y + ypos; int destX = realX * 8 + xpos; if (destY >= 0 && destY < _out.h && destX >= 0 && destX < _out.w) { - byte *dst = &(((byte*)_out.pixels)[destY * _out.pitch + destX]); + byte *dst = (byte *)_out.pixels + destY * _out.pitch + destX; + byte *mask = _vm->getMaskBuffer(0, destY, _zbuf); if (flipped) { LINE(0, 0); LINE(2, 2); LINE(4, 4); LINE(6, 6); } else { @@ -1094,6 +1099,7 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { } #undef LINE +#undef MASK_AT void C64CostumeRenderer::setCostume(int costume, int shadow) { _loaded.loadCostume(costume); |