diff options
author | James Brown | 2002-10-06 06:36:22 +0000 |
---|---|---|
committer | James Brown | 2002-10-06 06:36:22 +0000 |
commit | 79b95b6732b9d9ef7d7cfd08a6421a992b12d6fc (patch) | |
tree | 680a10305256dc7d2e722ccb843b7a9789c0d15a /scumm | |
parent | 9612002d78bbf76a80f462ea1036e20739b2d9ca (diff) | |
download | scummvm-rg350-79b95b6732b9d9ef7d7cfd08a6421a992b12d6fc.tar.gz scummvm-rg350-79b95b6732b9d9ef7d7cfd08a6421a992b12d6fc.tar.bz2 scummvm-rg350-79b95b6732b9d9ef7d7cfd08a6421a992b12d6fc.zip |
Reverse experimental AKOS codec 5 rewrite.
This rewrite causes touching the ladder at the Fuel Tower to crash
ScummVM again (in Full Throttle)
svn-id: r5091
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 150 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 46 |
2 files changed, 80 insertions, 116 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 7b420ecb03..ecd97b2b0f 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -860,136 +860,60 @@ void AkosRenderer::codec1_ignorePakCols(int num) void AkosRenderer::codec5() { VirtScreen *vs; + BompDrawData bdd; - int left, right, top, bottom; + int moveX; + int moveY; + int left; + int var_20; + int max_width; - byte *src, *dest; - int src_x, src_y; - uint dst_x, dst_y; + int right; + int top; + int bottom; - bool masking; - byte maskbit; - const byte *mask = NULL; - - // I don't know if this is complete. It used to simply call drawBomp() - // to draw an unscaled image, but I don't know if that was because it - // will never have to scale, or if it's because until quite recently - // drawBomp() didn't know how to scale images. - // - // What I do know is that drawBomp() doesn't care about masking and - // shadows, and these are both needed for Full Throttle. - vs = &_vm->virtscr[0]; + //setBlastObjectMode(shadow_mode); // not implemented yet + moveX = move_x_cur; + moveY = move_y_cur; if (!mirror) { - left = (x - move_x_cur - width) + 1; + left = (x - moveX - width) + 1; } else { - left = x + move_x_cur - 1; + left = x + moveX - 1; } - right = left + width; - top = y + move_y_cur; - bottom = top + height + 1; + var_20 = 0; + max_width = outwidth; + + right = left + width - 1; + top = y + moveY; + bottom = top + height; if (left < 0) left = 0; - if (left > (int) outwidth) - left -= left - outwidth; - - if (top < draw_top) - draw_top = top; - if (bottom > draw_bottom) - draw_bottom = bottom; - - _vm->updateDirtyRect(0, left, right, top, bottom, 1 << dirty_id); + if (left > max_width) + left -= left - max_width; - masking = false; - if (clipping) { - masking = _vm->isMaskActiveAt(left, top, right, bottom, - _vm->getResourceAddress(rtBuffer, 9) + - _vm->gdi._imgBufOffs[clipping] + - _vm->_screenStartStrip) != 0; - } - - v1.mask_ptr = NULL; - - if (masking || charsetmask || shadow_mode) { - v1.mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + - top * 40 + _vm->_screenStartStrip; - v1.imgbufoffs = _vm->gdi._imgBufOffs[clipping]; - if (!charsetmask && masking) { - v1.mask_ptr += v1.imgbufoffs; - v1.imgbufoffs = 0; - } - } + // Yazoo: this is not correct, but fix a lots of bugs for the momment - src = srcptr; - dest = outptr + top * outwidth + left + 1; + draw_top = 0; + draw_bottom = vs->height; - for (src_y = 0, dst_y = top; src_y < height; src_y++) { - byte code, color; - uint len, num, i; - byte *d = dest; + _vm->updateDirtyRect(0, left, right + 1, top, bottom + 1, 1 << dirty_id); - if (dst_y < 0 || dst_y >= outheight) { - src += READ_LE_UINT16(src) + 2; - mask += 40; - continue; - } + bdd.dataptr = srcptr; + bdd.out = outptr; + bdd.outheight = outheight; + bdd.outwidth = outwidth; + bdd.scale_x = 0xFF; + bdd.scale_y = 0xFF; + bdd.srcheight = height; + bdd.srcwidth = width; + bdd.x = left + 1; + bdd.y = top; - len = width; - src_x = 0; - dst_x = left + 1; - src += 2; - - while (src_x <width) { - code = *src++; - num = (code >> 1) + 1; - if (num > len) - num = len; - len -= num; - if (code & 1) { - color = *src++; - for (i = 0; i < num; i++) { - if (dst_x >= 0 && dst_x < outwidth) { - if (color != 255) { - if (v1.mask_ptr) - mask = v1.mask_ptr + (dst_x >> 3); - maskbit = revBitMask[dst_x & 7]; - if (shadow_mode && color == 13) - color = shadow_table[*d]; - if (!mask || !((mask[0] | mask[v1.imgbufoffs]) & maskbit)) - *d = color; - } - } - d++; - dst_x++; - src_x++; - } - } else { - for (i = 0; i < num; i++) { - color = src[i]; - if (dst_x >= 0 && dst_x < outwidth) { - if (color != 255) { - if (v1.mask_ptr) - mask = v1.mask_ptr + (dst_x >> 3); - maskbit = revBitMask[dst_x & 7]; - if (shadow_mode && color == 13) - color = shadow_table[*d]; - if (!mask || !((mask[0] | mask[v1.imgbufoffs]) & maskbit)) - *d = color; - } - } - d++; - dst_x++; - src_x++; - } - src += num; - } - } - dest += outwidth; - dst_y++; - } + _vm->drawBomp(&bdd, 0, bdd.dataptr, 0, 0); } void AkosRenderer::codec16() diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 62b6e3ba76..9c6f6d1faf 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -2736,11 +2736,51 @@ void Scumm::o6_miscOps() speed = 71; else speed = 1000 / _insaneFlag; - if (args[1] == 1) printf("startSmush one is true\n"); - if (args[2] == 1) printf("startSmush two is true\n"); + + debug(1, "INSANE Arg: %d", args[1]); + ScummRenderer * sr = new ScummRenderer(this, speed); SmushPlayer * sp = new SmushPlayer(sr); - sp->play((char*)getStringAddressVar(VAR_VIDEONAME), getGameDataPath()); + + // INSANE mode 0: SMUSH movie playback + if (args[1] == 0) { + sp->play((char*)getStringAddressVar(VAR_VIDEONAME), getGameDataPath()); + } else if (_gameId == GID_FT) { + // Full Throttle INSANE modes + switch (args[1]) { + case 0: + sp->play("minedriv.san", getGameDataPath()); + break; + case 1: + sp->play("tovista2.san", getGameDataPath()); + break; + case 2: + sp->play("tovista1.san", getGameDataPath()); + break; + case 3: + sp->play("minefite.san", getGameDataPath()); + break; + case 4: + sp->play("rottopen.san", getGameDataPath()); + break; + case 5: + case 6: + case 7: + case 8: + warning("FT_INSANE mode %d: Stub", args[1]); + break; + case 9: + sp->play("credits.san", getGameDataPath()); + default: + // Other INSANE modes + warning("Unknown FT_INSANE mode for %d", args[1]); + sp->play((char*)getStringAddressVar(VAR_VIDEONAME), getGameDataPath()); + } + } else { + // Other INSANE modes + warning("Unknown insane mode for %d", args[1]); + sp->play((char*)getStringAddressVar(VAR_VIDEONAME), getGameDataPath()); + } delete sp; delete sr; } |