diff options
author | Travis Howell | 2003-08-18 10:46:42 +0000 |
---|---|---|
committer | Travis Howell | 2003-08-18 10:46:42 +0000 |
commit | 9b5eb1137f418dabb4175ae60998287f51c41f47 (patch) | |
tree | e8c31cfd01bef8680f4deb3446e88d251f2c117d /scumm | |
parent | 034ea25fa6f0557cbf65f007b75a750f21212ffd (diff) | |
download | scummvm-rg350-9b5eb1137f418dabb4175ae60998287f51c41f47.tar.gz scummvm-rg350-9b5eb1137f418dabb4175ae60998287f51c41f47.tar.bz2 scummvm-rg350-9b5eb1137f418dabb4175ae60998287f51c41f47.zip |
Add support for flashlight in v1 maniac by converting older values.
Prevent warning about dummy function (Which has no purpose) in zak
svn-id: r9756
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/costume.cpp | 17 | ||||
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 40 |
3 files changed, 45 insertions, 13 deletions
diff --git a/scumm/costume.cpp b/scumm/costume.cpp index dd49885548..f19be6dc08 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -344,17 +344,15 @@ void CostumeRenderer::procC64(int actor) { byte palette[4] = { 0, 0, 0, 0 }; - if (_vm->_gameId == GID_MANIAC) { + if (!(_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_actor_color)) { + palette[2] = 11; + palette[3] = 11; + } else if (_vm->_gameId == GID_MANIAC) { palette[1] = v1_mm_actor_palatte_1[actor]; palette[2] = v1_mm_actor_palatte_2[actor]; } else { - if (!(_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_actor_color)) { - palette[2] = 11; - palette[3] = 11; - } else { - palette[1] = 8; - palette[2] = _palette[0]; - } + palette[1] = 8; + palette[2] = _palette[0]; } v1.skip_width >>= 3; @@ -734,8 +732,7 @@ void CostumeRenderer::setPalette(byte *palette) { byte color; if (_loaded._format == 0x57) { - _palette[0] = palette[0]; - + _palette[0] = palette[0]; return; } diff --git a/scumm/intern.h b/scumm/intern.h index 12cff79fc1..79e8e98f21 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -261,6 +261,7 @@ protected: void o2_isGreaterEqual(); void o2_isLess(); void o2_isLessEqual(); + void o2_lights(); void o2_loadRoomWithEgo(); void o2_setBoxFlags(); void o2_panCameraTo(); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 70876372c2..24b2fcdd9f 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -173,7 +173,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_dummy), OPCODE(o2_ifState04), /* 70 */ - OPCODE(o5_lights), + OPCODE(o2_lights), OPCODE(o5_getActorCostume), OPCODE(o5_loadRoom), OPCODE(o2_roomOps), @@ -333,7 +333,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_dummy), OPCODE(o2_ifState04), /* F0 */ - OPCODE(o5_lights), + OPCODE(o2_lights), OPCODE(o5_getActorCostume), OPCODE(o5_loadRoom), OPCODE(o2_roomOps), @@ -1214,6 +1214,38 @@ void Scumm_v2::o2_isLessEqual() { o5_jumpRelative(); } +void Scumm_v2::o2_lights() { + warning("o2_lights"); + int a, b, c; + + a = getVarOrDirectByte(0x80); + b = fetchScriptByte(); + c = fetchScriptByte(); + + if (c == 0) { + if (_gameId == GID_MANIAC && _version == 1) { + // Convert older light mode values into + // equivalent values.of later games + // 0 Darkness + // 1 Flashlight + // 2 Lighted area + if (a == 2) + VAR(VAR_CURRENT_LIGHTS) = 11; + else if (a == 1) + VAR(VAR_CURRENT_LIGHTS) = 4; + else if (a == 0) + VAR(VAR_CURRENT_LIGHTS) = 0; + else + warning("o2_lights: light mode %d unknown", a); +; } else + VAR(VAR_CURRENT_LIGHTS) = a; + } else if (c == 1) { + _flashlight.xStrips = a; + _flashlight.yStrips = b; + } + _fullRedraw = 1; +} + void Scumm_v2::o2_loadRoomWithEgo() { Actor *a; int obj, room, x, y; @@ -1500,7 +1532,9 @@ void Scumm_v2::o2_getActorWalkBox() { } void Scumm_v2::o2_dummy() { - warning("o2_dummy invoked (opcode %d)", _opcode); + // Opcode 238 is used in Zak but has no purpose + if (!(_gameId == GID_ZAK && _opcode == 238)) + warning("o2_dummy invoked (opcode %d)", _opcode); } void Scumm_v2::o2_switchCostumeSet() { |