diff options
author | johndoe123 | 2014-12-03 21:18:34 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 70f83137b142d3158efb5dbcf82e7ab36174693a (patch) | |
tree | a6dc327b109f86dbcd836059b47c700c108e18bc /engines/illusions/duckman | |
parent | e4a85c7da6486f0221ef34dc0d2e82100533a213 (diff) | |
download | scummvm-rg350-70f83137b142d3158efb5dbcf82e7ab36174693a.tar.gz scummvm-rg350-70f83137b142d3158efb5dbcf82e7ab36174693a.tar.bz2 scummvm-rg350-70f83137b142d3158efb5dbcf82e7ab36174693a.zip |
ILLUSIONS: Move Duckman special code to own class and file
Diffstat (limited to 'engines/illusions/duckman')
-rw-r--r-- | engines/illusions/duckman/duckman_specialcode.cpp | 265 | ||||
-rw-r--r-- | engines/illusions/duckman/duckman_specialcode.h | 72 | ||||
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.cpp | 233 | ||||
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.h | 26 |
4 files changed, 344 insertions, 252 deletions
diff --git a/engines/illusions/duckman/duckman_specialcode.cpp b/engines/illusions/duckman/duckman_specialcode.cpp new file mode 100644 index 0000000000..8626fd150e --- /dev/null +++ b/engines/illusions/duckman/duckman_specialcode.cpp @@ -0,0 +1,265 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "illusions/duckman/illusions_duckman.h" +#include "illusions/duckman/duckman_specialcode.h" +#include "illusions/actor.h" +#include "illusions/resources/scriptresource.h" +#include "illusions/scriptopcodes_duckman.h" +#include "illusions/specialcode.h" + +#include "engines/util.h" + +namespace Illusions { + +// Duckman_SpecialCode + +DuckmanSpecialCode::DuckmanSpecialCode(IllusionsEngine_Duckman *vm) + : _vm(vm) { +} + +DuckmanSpecialCode::~DuckmanSpecialCode() { +} + +typedef Common::Functor1Mem<OpCall&, void, DuckmanSpecialCode> SpecialCodeFunctionDM; +#define SPECIAL(id, func) _specialCodeMap[id] = new SpecialCodeFunctionDM(this, &DuckmanSpecialCode::func); + +void DuckmanSpecialCode::init() { + // TODO + SPECIAL(0x00160001, spcStartScreenShaker); + SPECIAL(0x00160002, spcSetCursorHandMode); + SPECIAL(0x00160003, spcResetChinesePuzzle); + SPECIAL(0x00160004, spcAddChinesePuzzleAnswer); + SPECIAL(0x00160005, spcOpenInventory); + SPECIAL(0x00160007, spcPutBackInventoryItem); + SPECIAL(0x00160008, spcClearInventorySlot); + SPECIAL(0x0016000A, spcAddPropertyTimer); + SPECIAL(0x0016000B, spcSetPropertyTimer); + SPECIAL(0x0016000C, spcRemovePropertyTimer); + SPECIAL(0x00160010, spcCenterNewspaper); + SPECIAL(0x00160014, spcUpdateObject272Sequence); + SPECIAL(0x0016001C, spcSetCursorInventoryMode); +} + +#undef SPECIAL + +void DuckmanSpecialCode::run(uint32 specialCodeId, OpCall &opCall) { + SpecialCodeMapIterator it = _specialCodeMap.find(specialCodeId); + if (it != _specialCodeMap.end()) { + (*(*it)._value)(opCall); + } else { + debug("DuckmanSpecialCode::run() Unimplemented special code %08X", specialCodeId); + _vm->notifyThreadId(opCall._threadId); + } +} + +// TODO Move to separate file + +static const ScreenShakerPoint kShakerPoints0[] = { + {0, -2}, {0, -4}, {0, -3}, {0, -1}, {0, 1} +}; + +static const ScreenShakeEffect kShakerEffect0 = { + 6, 5, kShakerPoints0 +}; + +static const ScreenShakerPoint kShakerPoints1[] = { + {-4, -5}, {4, 5}, {-3, -4}, {3, 4}, {-2, -3}, {2, 3}, {-1, -2}, + { 1, 2}, {0, -1} +}; + +static const ScreenShakeEffect kShakerEffect1 = { + 9, 2, kShakerPoints1 +}; + +static const ScreenShakerPoint kShakerPoints2[] = { + {0, -3}, {0, 3}, {0, -2}, {0, 2}, {0, -2}, {0, 2}, {0, -1}, + {0, 1}, {0, -1}, +}; + +static const ScreenShakeEffect kShakerEffect2 = { + 9, 2, kShakerPoints2 +}; + +static const ScreenShakerPoint kShakerPoints3[] = { + {0, 1}, {0, -1}, {0, -2}, {0, 0}, {(int16)32768, 0} +}; + +static const ScreenShakeEffect kShakerEffect3 = { + 5, 2, kShakerPoints3 +}; + +static const ScreenShakerPoint kShakerPoints4[] = { + {0, 4}, {0, -1}, {0, 3}, {0, -2}, {0, 1}, {0, -1}, {0, 1}, {0, -1} +}; + +static const ScreenShakeEffect kShakerEffect4 = { + 8, 5, kShakerPoints4 +}; + +static const ScreenShakerPoint kShakerPoints5[] = { + {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, + {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, + {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, + {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0} +}; + +static const ScreenShakeEffect kShakerEffect5 = { + 31, 2, kShakerPoints5 +}; + +static const ScreenShakeEffect *kShakerEffects[] = { + &kShakerEffect0, + &kShakerEffect1, + &kShakerEffect2, + &kShakerEffect3, + &kShakerEffect4, + &kShakerEffect5 +}; + +void DuckmanSpecialCode::spcStartScreenShaker(OpCall &opCall) { + ARG_BYTE(effect); + const ScreenShakeEffect *shakerEffect = kShakerEffects[effect]; + _vm->startScreenShaker(shakerEffect->_pointsCount, shakerEffect->_duration, shakerEffect->_points, opCall._threadId); +} + +void DuckmanSpecialCode::spcSetCursorHandMode(OpCall &opCall) { + ARG_BYTE(mode); + _vm->setCursorHandMode(mode); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcResetChinesePuzzle(OpCall &opCall) { + _vm->_scriptResource->_properties.set(0x000E0018, false); + _vm->_scriptResource->_properties.set(0x000E0019, false); + _chinesePuzzleIndex = 0; + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcAddChinesePuzzleAnswer(OpCall &opCall) { + ARG_BYTE(answer); + _chinesePuzzleAnswers[_chinesePuzzleIndex++] = answer; + if (_chinesePuzzleIndex == 3) { + _vm->_scriptResource->_properties.set(0x000E0018, true); + if ((_chinesePuzzleAnswers[0] == 7 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 5) || + (_chinesePuzzleAnswers[0] == 5 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 7)) + _vm->_scriptResource->_properties.set(0x000E0019, true); + else if ((_chinesePuzzleAnswers[0] == 7 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 1) || + (_chinesePuzzleAnswers[0] == 1 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 7)) + _vm->_scriptResource->_properties.set(0x000E00A0, true); + } + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcOpenInventory(OpCall &opCall) { + _vm->openInventory(); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcPutBackInventoryItem(OpCall &opCall) { + _vm->putBackInventoryItem(); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcClearInventorySlot(OpCall &opCall) { + ARG_UINT32(objectId); + _vm->clearInventorySlot(objectId); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcAddPropertyTimer(OpCall &opCall) { + ARG_UINT32(propertyId); + _vm->addPropertyTimer(propertyId); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcSetPropertyTimer(OpCall &opCall) { + ARG_INT16(propertyNum); + ARG_INT16(duration); + _vm->setPropertyTimer(propertyNum | 0xE0000, duration); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcRemovePropertyTimer(OpCall &opCall) { + ARG_UINT32(propertyId); + _vm->removePropertyTimer(propertyId); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcCenterNewspaper(OpCall &opCall) { + Control *control = _vm->getObjectControl(0x40017); + control->_flags |= 8; + control->_actor->_position.x = 160; + control->_actor->_position.y = 100; + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcSetCursorInventoryMode(OpCall &opCall) { + ARG_BYTE(mode); + ARG_BYTE(value); + _vm->setCursorInventoryMode(mode, value); + _vm->notifyThreadId(opCall._threadId); +} + +void DuckmanSpecialCode::spcUpdateObject272Sequence(OpCall &opCall) { + byte flags = 0; + uint32 sequenceId; + if (_vm->_scriptResource->_properties.get(0x000E0085)) + flags |= 1; + if (_vm->_scriptResource->_properties.get(0x000E0083)) + flags |= 2; + if (_vm->_scriptResource->_properties.get(0x000E0084)) + flags |= 4; + switch (flags) { + case 0: + sequenceId = 0x603C1; + break; + case 1: + sequenceId = 0x603BF; + break; + case 2: + sequenceId = 0x603C2; + break; + case 3: + sequenceId = 0x603C0; + break; + case 4: + sequenceId = 0x603C3; + break; + case 5: + sequenceId = 0x603C5; + break; + case 6: + sequenceId = 0x603C4; + break; + case 7: + sequenceId = 0x603C6; + break; + default: + sequenceId = 0x603C1; + break; + } + Control *control = _vm->getObjectControl(0x40110); + control->startSequenceActor(sequenceId, 2, opCall._threadId); +} + +} // End of namespace Illusions diff --git a/engines/illusions/duckman/duckman_specialcode.h b/engines/illusions/duckman/duckman_specialcode.h new file mode 100644 index 0000000000..366a7366b4 --- /dev/null +++ b/engines/illusions/duckman/duckman_specialcode.h @@ -0,0 +1,72 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef ILLUSIONS_DUCKMAN_SPECIALCODE_H +#define ILLUSIONS_DUCKMAN_SPECIALCODE_H + +#include "illusions/illusions.h" +#include "illusions/specialcode.h" +#include "common/algorithm.h" + +namespace Illusions { + +class IllusionsEngine_Duckman; + +typedef Common::Functor1<OpCall&, void> SpecialCodeFunction; + +class DuckmanSpecialCode : public SpecialCode { +public: + DuckmanSpecialCode(IllusionsEngine_Duckman *vm); + ~DuckmanSpecialCode(); + virtual void init(); + virtual void run(uint32 specialCodeId, OpCall &opCall); +public: + typedef Common::HashMap<uint32, SpecialCodeFunction*> SpecialCodeMap; + typedef SpecialCodeMap::iterator SpecialCodeMapIterator; + + IllusionsEngine_Duckman *_vm; + SpecialCodeMap _specialCodeMap; + + uint _chinesePuzzleIndex; + byte _chinesePuzzleAnswers[3]; + + // Special code interface functions + void runSpecialCode(uint32 specialCodeId, OpCall &opCall); + void spcStartScreenShaker(OpCall &opCall); + void spcSetCursorHandMode(OpCall &opCall); + void spcResetChinesePuzzle(OpCall &opCall); + void spcAddChinesePuzzleAnswer(OpCall &opCall); + void spcOpenInventory(OpCall &opCall); + void spcPutBackInventoryItem(OpCall &opCall); + void spcClearInventorySlot(OpCall &opCall); + void spcAddPropertyTimer(OpCall &opCall); + void spcSetPropertyTimer(OpCall &opCall); + void spcRemovePropertyTimer(OpCall &opCall); + void spcCenterNewspaper(OpCall &opCall); + void spcSetCursorInventoryMode(OpCall &opCall); + void spcUpdateObject272Sequence(OpCall &opCall); + +}; + +} // End of namespace Illusions + +#endif // ILLUSIONS_ILLUSIONS_H diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp index a180f2d201..600a34777c 100644 --- a/engines/illusions/duckman/illusions_duckman.cpp +++ b/engines/illusions/duckman/illusions_duckman.cpp @@ -21,6 +21,7 @@ */ #include "illusions/duckman/illusions_duckman.h" +#include "illusions/duckman/duckman_specialcode.h" #include "illusions/actor.h" #include "illusions/camera.h" #include "illusions/cursor.h" @@ -133,7 +134,7 @@ Common::Error IllusionsEngine_Duckman::run() { _globalSceneId = 0x00010003; initInventory(); - initSpecialCode(); + loadSpecialCode(0); setDefaultTextCoords(); initCursor(); initActiveScenes(); @@ -141,7 +142,7 @@ Common::Error IllusionsEngine_Duckman::run() { _resSys->loadResource(0x120001, 0x00010001, 0); _resSys->loadResource(0x120002, 0x00010001, 0); _resSys->loadResource(0x120003, 0x00010001, 0); - + _resSys->loadResource(0x000D0001, 0x00010001, 0); startScriptThread(0x00020004, 0); _doScriptThreadInit = true; @@ -163,6 +164,8 @@ Common::Error IllusionsEngine_Duckman::run() { updateEvents(); } + unloadSpecialCode(0); + delete _stack; delete _scriptOpcodes; @@ -290,7 +293,8 @@ void IllusionsEngine_Duckman::setDefaultTextCoords() { } void IllusionsEngine_Duckman::loadSpecialCode(uint32 resId) { - //TODO? + _specialCode = new DuckmanSpecialCode(this); + _specialCode->init(); } void IllusionsEngine_Duckman::unloadSpecialCode(uint32 resId) { @@ -1358,227 +1362,4 @@ int IllusionsEngine_Duckman::updatePropertyTimers(uint flags) { return result; } -// Special code - -typedef Common::Functor1Mem<OpCall&, void, IllusionsEngine_Duckman> SpecialCodeFunctionDM; -#define SPECIAL(id, func) _specialCodeMap[id] = new SpecialCodeFunctionDM(this, &IllusionsEngine_Duckman::func); - -void IllusionsEngine_Duckman::initSpecialCode() { - SPECIAL(0x00160001, spcStartScreenShaker); - SPECIAL(0x00160002, spcSetCursorHandMode); - SPECIAL(0x00160003, spcResetChinesePuzzle); - SPECIAL(0x00160004, spcAddChinesePuzzleAnswer); - SPECIAL(0x00160005, spcOpenInventory); - SPECIAL(0x00160007, spcPutBackInventoryItem); - SPECIAL(0x00160008, spcClearInventorySlot); - SPECIAL(0x0016000A, spcAddPropertyTimer); - SPECIAL(0x0016000B, spcSetPropertyTimer); - SPECIAL(0x0016000C, spcRemovePropertyTimer); - SPECIAL(0x00160010, spcCenterNewspaper); - SPECIAL(0x00160014, spcUpdateObject272Sequence); - SPECIAL(0x0016001C, spcSetCursorInventoryMode); -} - -#undef SPECIAL - -void IllusionsEngine_Duckman::runSpecialCode(uint32 specialCodeId, OpCall &opCall) { - SpecialCodeMapIterator it = _specialCodeMap.find(specialCodeId); - if (it != _specialCodeMap.end()) { - (*(*it)._value)(opCall); - } else { - debug("IllusionsEngine_Duckman::runSpecialCode() Unimplemented special code %08X", specialCodeId); - notifyThreadId(opCall._threadId); - } -} - -// TODO Move to separate file - -static const ScreenShakerPoint kShakerPoints0[] = { - {0, -2}, {0, -4}, {0, -3}, {0, -1}, {0, 1} -}; - -static const ScreenShakeEffect kShakerEffect0 = { - 6, 5, kShakerPoints0 -}; - -static const ScreenShakerPoint kShakerPoints1[] = { - {-4, -5}, {4, 5}, {-3, -4}, {3, 4}, {-2, -3}, {2, 3}, {-1, -2}, - { 1, 2}, {0, -1} -}; - -static const ScreenShakeEffect kShakerEffect1 = { - 9, 2, kShakerPoints1 -}; - -static const ScreenShakerPoint kShakerPoints2[] = { - {0, -3}, {0, 3}, {0, -2}, {0, 2}, {0, -2}, {0, 2}, {0, -1}, - {0, 1}, {0, -1}, -}; - -static const ScreenShakeEffect kShakerEffect2 = { - 9, 2, kShakerPoints2 -}; - -static const ScreenShakerPoint kShakerPoints3[] = { - {0, 1}, {0, -1}, {0, -2}, {0, 0}, {(int16)32768, 0} -}; - -static const ScreenShakeEffect kShakerEffect3 = { - 5, 2, kShakerPoints3 -}; - -static const ScreenShakerPoint kShakerPoints4[] = { - {0, 4}, {0, -1}, {0, 3}, {0, -2}, {0, 1}, {0, -1}, {0, 1}, {0, -1} -}; - -static const ScreenShakeEffect kShakerEffect4 = { - 8, 5, kShakerPoints4 -}; - -static const ScreenShakerPoint kShakerPoints5[] = { - {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, - {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, - {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0}, - {0, -1}, {0, 0}, {0, 1}, {0, 0}, {0, -1}, {0, 0}, {0, 1}, {0, 0} -}; - -static const ScreenShakeEffect kShakerEffect5 = { - 31, 2, kShakerPoints5 -}; - -static const ScreenShakeEffect *kShakerEffects[] = { - &kShakerEffect0, - &kShakerEffect1, - &kShakerEffect2, - &kShakerEffect3, - &kShakerEffect4, - &kShakerEffect5 -}; - -void IllusionsEngine_Duckman::spcStartScreenShaker(OpCall &opCall) { - ARG_BYTE(effect); - const ScreenShakeEffect *shakerEffect = kShakerEffects[effect]; - startScreenShaker(shakerEffect->_pointsCount, shakerEffect->_duration, shakerEffect->_points, opCall._threadId); -} - -void IllusionsEngine_Duckman::spcSetCursorHandMode(OpCall &opCall) { - ARG_BYTE(mode); - setCursorHandMode(mode); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcResetChinesePuzzle(OpCall &opCall) { - _scriptResource->_properties.set(0x000E0018, false); - _scriptResource->_properties.set(0x000E0019, false); - _chinesePuzzleIndex = 0; - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcAddChinesePuzzleAnswer(OpCall &opCall) { - ARG_BYTE(answer); - _chinesePuzzleAnswers[_chinesePuzzleIndex++] = answer; - if (_chinesePuzzleIndex == 3) { - _scriptResource->_properties.set(0x000E0018, true); - if ((_chinesePuzzleAnswers[0] == 7 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 5) || - (_chinesePuzzleAnswers[0] == 5 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 7)) - _scriptResource->_properties.set(0x000E0019, true); - else if ((_chinesePuzzleAnswers[0] == 7 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 1) || - (_chinesePuzzleAnswers[0] == 1 && _chinesePuzzleAnswers[1] == 2 && _chinesePuzzleAnswers[2] == 7)) - _scriptResource->_properties.set(0x000E00A0, true); - } - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcOpenInventory(OpCall &opCall) { - openInventory(); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcPutBackInventoryItem(OpCall &opCall) { - putBackInventoryItem(); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcClearInventorySlot(OpCall &opCall) { - ARG_UINT32(objectId); - clearInventorySlot(objectId); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcAddPropertyTimer(OpCall &opCall) { - ARG_UINT32(propertyId); - addPropertyTimer(propertyId); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcSetPropertyTimer(OpCall &opCall) { - ARG_INT16(propertyNum); - ARG_INT16(duration); - setPropertyTimer(propertyNum | 0xE0000, duration); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcRemovePropertyTimer(OpCall &opCall) { - ARG_UINT32(propertyId); - removePropertyTimer(propertyId); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcCenterNewspaper(OpCall &opCall) { - Control *control = getObjectControl(0x40017); - control->_flags |= 8; - control->_actor->_position.x = 160; - control->_actor->_position.y = 100; - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcSetCursorInventoryMode(OpCall &opCall) { - ARG_BYTE(mode); - ARG_BYTE(value); - setCursorInventoryMode(mode, value); - notifyThreadId(opCall._threadId); -} - -void IllusionsEngine_Duckman::spcUpdateObject272Sequence(OpCall &opCall) { - byte flags = 0; - uint32 sequenceId; - if (_scriptResource->_properties.get(0x000E0085)) - flags |= 1; - if (_scriptResource->_properties.get(0x000E0083)) - flags |= 2; - if (_scriptResource->_properties.get(0x000E0084)) - flags |= 4; - switch (flags) { - case 0: - sequenceId = 0x603C1; - break; - case 1: - sequenceId = 0x603BF; - break; - case 2: - sequenceId = 0x603C2; - break; - case 3: - sequenceId = 0x603C0; - break; - case 4: - sequenceId = 0x603C3; - break; - case 5: - sequenceId = 0x603C5; - break; - case 6: - sequenceId = 0x603C4; - break; - case 7: - sequenceId = 0x603C6; - break; - default: - sequenceId = 0x603C1; - break; - } - Control *control = getObjectControl(0x40110); - control->startSequenceActor(sequenceId, 2, opCall._threadId); -} - } // End of namespace Illusions diff --git a/engines/illusions/duckman/illusions_duckman.h b/engines/illusions/duckman/illusions_duckman.h index 7f6c427b78..b21a83d8be 100644 --- a/engines/illusions/duckman/illusions_duckman.h +++ b/engines/illusions/duckman/illusions_duckman.h @@ -103,10 +103,6 @@ const uint kPropertyTimersCount = 6; struct OpCall; -typedef Common::Functor1<OpCall&, void> SpecialCodeFunction; -typedef Common::HashMap<uint32, SpecialCodeFunction*> SpecialCodeMap; -typedef SpecialCodeMap::iterator SpecialCodeMapIterator; - class IllusionsEngine_Duckman : public IllusionsEngine { public: IllusionsEngine_Duckman(OSystem *syst, const IllusionsGameDescription *gd); @@ -139,11 +135,6 @@ public: bool _propertyTimersActive; bool _propertyTimersPaused; - uint _chinesePuzzleIndex; - byte _chinesePuzzleAnswers[3]; - - SpecialCodeMap _specialCodeMap; - void initUpdateFunctions(); int updateScript(uint flags); @@ -240,23 +231,6 @@ public: bool findPropertyTimer(uint32 propertyId, PropertyTimer *&propertyTimer); int updatePropertyTimers(uint flags); - // Special code - void initSpecialCode(); - void runSpecialCode(uint32 specialCodeId, OpCall &opCall); - void spcStartScreenShaker(OpCall &opCall); - void spcSetCursorHandMode(OpCall &opCall); - void spcResetChinesePuzzle(OpCall &opCall); - void spcAddChinesePuzzleAnswer(OpCall &opCall); - void spcOpenInventory(OpCall &opCall); - void spcPutBackInventoryItem(OpCall &opCall); - void spcClearInventorySlot(OpCall &opCall); - void spcAddPropertyTimer(OpCall &opCall); - void spcSetPropertyTimer(OpCall &opCall); - void spcRemovePropertyTimer(OpCall &opCall); - void spcCenterNewspaper(OpCall &opCall); - void spcSetCursorInventoryMode(OpCall &opCall); - void spcUpdateObject272Sequence(OpCall &opCall); - }; } // End of namespace Illusions |