[Scummvm-cvs-logs] SF.net SVN: scummvm: [21250] scummvm/trunk/engines/scumm
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sun Mar 12 22:07:04 CET 2006
Revision: 21250
Author: kirben
Date: 2006-03-12 22:06:51 -0800 (Sun, 12 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21250&view=rev
Log Message:
-----------
Add masking support for C64 maniac, not perfect
Modified Paths:
--------------
scummvm/trunk/engines/scumm/boxes.cpp
scummvm/trunk/engines/scumm/costume.cpp
Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp 2006-03-13 03:52:26 UTC (rev 21249)
+++ scummvm/trunk/engines/scumm/boxes.cpp 2006-03-13 06:06:51 UTC (rev 21250)
@@ -42,7 +42,7 @@
byte x2;
byte y1;
byte y2;
- byte flags;
+ byte mask;
} GCC_PACK c64;
struct {
@@ -111,8 +111,7 @@
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 @@
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 @@
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
Modified: scummvm/trunk/engines/scumm/costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/costume.cpp 2006-03-13 03:52:26 UTC (rev 21249)
+++ scummvm/trunk/engines/scumm/costume.cpp 2006-03-13 06:06:51 UTC (rev 21250)
@@ -981,11 +981,15 @@
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 @@
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 @@
}
#undef LINE
+#undef MASK_AT
void C64CostumeRenderer::setCostume(int costume, int shadow) {
_loaded.loadCostume(costume);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list