aboutsummaryrefslogtreecommitdiff
path: root/scumm/nut_renderer.cpp
diff options
context:
space:
mode:
authorMax Horn2002-12-31 20:52:11 +0000
committerMax Horn2002-12-31 20:52:11 +0000
commitd65915beff769104b5b38683937bc5a15827e9c1 (patch)
treebeb548b604a1da52ea26d90fb6669153db02f59d /scumm/nut_renderer.cpp
parent1517ce3894a0e6441d339eeff9598a2d4b961ec9 (diff)
downloadscummvm-rg350-d65915beff769104b5b38683937bc5a15827e9c1.tar.gz
scummvm-rg350-d65915beff769104b5b38683937bc5a15827e9c1.tar.bz2
scummvm-rg350-d65915beff769104b5b38683937bc5a15827e9c1.zip
added masking to nut charset renderer
svn-id: r6300
Diffstat (limited to 'scumm/nut_renderer.cpp')
-rw-r--r--scumm/nut_renderer.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp
index 298ca0c4c8..17c0385db7 100644
--- a/scumm/nut_renderer.cpp
+++ b/scumm/nut_renderer.cpp
@@ -199,6 +199,11 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) {
byte * src = (byte*)(_dataSrc + _offsets[c] + 14);
byte * dst = _vm->virtscr[0].screenPtr + y * _vm->_realWidth + x + _vm->virtscr[0].xstart;
+ byte *mask = _vm->getResourceAddress(rtBuffer, 9)
+ + (y * _vm->_realWidth + x) / 8 + _vm->_screenStartStrip;
+ byte maskmask;
+ int maskpos;
+
uint32 length = READ_BE_UINT32(_dataSrc + _offsets[c] - 4) - 14;
decodeCodec44(_tmpCodecBuffer, src, length);
@@ -206,8 +211,10 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) {
int32 width = READ_LE_UINT16(_dataSrc + _offsets[c] + 6);
int32 height = READ_LE_UINT16(_dataSrc + _offsets[c] + 8);
-
+
for (int32 ty = 0; ty < height; ty++) {
+ maskmask = revBitMask[x & 7];
+ maskpos = 0;
for (int32 tx = 0; tx < width; tx++) {
byte pixel = *src++;
#if 1
@@ -218,9 +225,12 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) {
// in addition to the normal font. Or maybe the created the shadows dynamically
// on the fly: if we draw the character several times in black, moved a bit
// each time, that would mostly create the shadow effect. But why would they
- // do this, as it would increase the char drawing time by factor 5-6 ?
- if (pixel != 0)
+ // do this, as it would increase the char drawing time by factor 5-6 ? And in
+ // fact, even then the shadow would not be 100% right.
+ if (pixel != 0) {
+ mask[maskpos] |= maskmask;
dst[tx] = color;
+ }
#else
if (pixel != 0) {
if (pixel == 0x01)
@@ -230,7 +240,13 @@ void NutRenderer::drawChar(char c, int32 x, int32 y, byte color) {
dst[tx] = pixel;
}
#endif
+ maskmask >>= 1;
+ if (maskmask == 0) {
+ maskmask = 0x80;
+ maskpos++;
+ }
}
dst += _vm->_realWidth;
+ mask += _vm->gdi._numStrips;
}
}