aboutsummaryrefslogtreecommitdiff
path: root/scumm/akos.cpp
diff options
context:
space:
mode:
authorJames Brown2002-10-16 13:43:31 +0000
committerJames Brown2002-10-16 13:43:31 +0000
commitc0a42d5450ffe2f30551f9f7b022ce819ee805ab (patch)
tree46dd5a293ddaae5a6fc81f0811419e8107bcaba7 /scumm/akos.cpp
parent9070ff0eafe58cc41e092c820041bc3e528be559 (diff)
downloadscummvm-rg350-c0a42d5450ffe2f30551f9f7b022ce819ee805ab.tar.gz
scummvm-rg350-c0a42d5450ffe2f30551f9f7b022ce819ee805ab.tar.bz2
scummvm-rg350-c0a42d5450ffe2f30551f9f7b022ce819ee805ab.zip
Implement akos codec 1, shadow mode 3
svn-id: r5167
Diffstat (limited to 'scumm/akos.cpp')
-rw-r--r--scumm/akos.cpp73
1 files changed, 71 insertions, 2 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index acd038a9e6..729ffd8669 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -437,6 +437,76 @@ void akos_c1_spec1(AkosRenderer * ar)
} while (1);
}
+void akos_c1_spec3(AkosRenderer * ar)
+{
+ byte *src, *dst;
+ byte len, height, maskbit;
+ uint y, color, pcolor;
+ const byte *scaleytab, *mask;
+
+
+ y = ar->v1.y;
+
+ len = ar->v1.replen;
+ src = ar->srcptr;
+ dst = ar->v1.destptr;
+ color = ar->v1.repcolor;
+ height = ar->height;
+
+ scaleytab = &ar->v1.scaletable[ar->v1.tmp_y];
+ maskbit = revBitMask[ar->v1.x & 7];
+ mask = ar->v1.mask_ptr + (ar->v1.x >> 3);
+
+ if (len)
+ goto StartPos;
+
+ do {
+ len = *src++;
+ color = len >> ar->v1.shl;
+ len &= ar->v1.mask;
+ if (!len)
+ len = *src++;
+
+ do {
+ if (*scaleytab++ < ar->scale_y) {
+ if (color && y < ar->outheight
+ && (!ar->v1.mask_ptr || !((mask[0] | mask[ar->v1.imgbufoffs]) & maskbit))) {
+ pcolor = ar->palette[color];
+ if (pcolor < 8) {
+ pcolor = (pcolor << 8) + *dst;
+ *dst = ar->shadow_table[pcolor];
+ } else {
+ *dst = pcolor;
+ }
+ }
+ mask += 40;
+ dst += ar->outwidth;
+ y++;
+ }
+ if (!--height) {
+ if (!--ar->v1.skip_width)
+ return;
+ height = ar->height;
+ y = ar->v1.y;
+
+ scaleytab = &ar->v1.scaletable[ar->v1.tmp_y];
+
+ if (ar->v1.scaletable[ar->v1.tmp_x] < ar->scale_x) {
+ ar->v1.x += ar->v1.scaleXstep;
+ if (ar->v1.x >= g_scumm->_realWidth)
+ return;
+ maskbit = revBitMask[ar->v1.x & 7];
+ ar->v1.destptr += ar->v1.scaleXstep;
+ }
+ mask = ar->v1.mask_ptr + (ar->v1.x >> 3);
+ ar->v1.tmp_x += ar->v1.scaleXstep;
+ dst = ar->v1.destptr;
+ }
+ StartPos:;
+ } while (--len);
+ } while (1);
+}
+
const byte default_scale_table[768] = {
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
@@ -775,8 +845,7 @@ void AkosRenderer::codec1()
warning("akos_c1_spec2");
return;
case 3:
-// akos_c1_spec3(this);
- warning("akos_c1_spec3");
+ akos_c1_spec3(this);
return;
}