From 88e2b3fd9ee11ac724a676e8496e36691551e1c8 Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Mon, 7 Dec 2015 13:26:14 +0100 Subject: ILLUSIONS: BBDOU: Implement special code 160030 --- engines/illusions/bbdou/bbdou_cursor.cpp | 33 +++++++++++++++++++++++++++ engines/illusions/bbdou/bbdou_cursor.h | 1 + engines/illusions/bbdou/bbdou_specialcode.cpp | 8 +++++++ engines/illusions/bbdou/bbdou_specialcode.h | 1 + 4 files changed, 43 insertions(+) (limited to 'engines') diff --git a/engines/illusions/bbdou/bbdou_cursor.cpp b/engines/illusions/bbdou/bbdou_cursor.cpp index 4b9230b77b..61422a8e68 100644 --- a/engines/illusions/bbdou/bbdou_cursor.cpp +++ b/engines/illusions/bbdou/bbdou_cursor.cpp @@ -96,6 +96,39 @@ void BbdouCursor::disable(uint32 objectId) { hide(objectId); } +void BbdouCursor::reset(uint32 objectId) { + Control *control = _vm->_dict->getObjectControl(objectId); + + _data._item10._field0 = 1; + _data._mode = 1; + _data._mode2 = 0; + _data._verbId1 = 0x1B0000; + _data._currOverlappedObjectId = 0; + _data._overlappedObjectId = 0; + _data._sequenceId = 0x6000F; + _data._holdingObjectId = 0; + _data._holdingObjectId2 = 0; + _data._visibleCtr = 0; + _data._causeThreadId1 = 0; + _data._flags = 0; + _data._item10._field58 = 1; + _data._sequenceId98 = 0; + _data._idleCtr = 0; + _data._item10._verbId = 0x1B0000; + _data._item10._playSound48 = 0; + _data._item10._objectIds[0] = 0; + _data._item10._objectIds[1] = 0; + _data._item10._index = 0; + _data._item10._flag56 = 0; + clearCursorDataField14(); + control->setActorIndexTo1(); + control->startSequenceActor(0x60029, 2, 0); + + _bbdou->resetItem10(control->_objectId, &_data._item10); + // TODO? control->_actor->setControlRoutine(new Common::Functor2Mem(this, &BbdouCursor::cursorInteractControlRoutine)); + +} + void BbdouCursor::addCursorSequence(uint32 objectId, uint32 sequenceId) { for (uint i = 0; i < kMaxCursorSequences; ++i) if (_cursorSequences[i]._objectId == 0) { diff --git a/engines/illusions/bbdou/bbdou_cursor.h b/engines/illusions/bbdou/bbdou_cursor.h index 7b42e4f307..8f454b76cc 100644 --- a/engines/illusions/bbdou/bbdou_cursor.h +++ b/engines/illusions/bbdou/bbdou_cursor.h @@ -90,6 +90,7 @@ public: void init(uint32 objectId, uint32 progResKeywordId); void enable(uint32 objectId); void disable(uint32 objectId); + void reset(uint32 objectId); void addCursorSequence(uint32 objectId, uint32 sequenceId); uint32 findCursorSequenceId(uint32 objectId); void setStruct8bsValue(uint32 objectId, int value); diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp index 5257a48858..b10b8d287a 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.cpp +++ b/engines/illusions/bbdou/bbdou_specialcode.cpp @@ -124,6 +124,7 @@ typedef Common::Functor1Mem SpecialCodeFunction void BbdouSpecialCode::init() { // TODO + // 0x00160001 only used for original debugging purposes SPECIAL(0x00160006, spcInitCursor); SPECIAL(0x00160008, spcEnableCursor); SPECIAL(0x00160009, spcDisableCursor); @@ -141,6 +142,7 @@ void BbdouSpecialCode::init() { SPECIAL(0x0016001E, spcRemoveInventoryItem); SPECIAL(0x0016001F, spcHasInventoryItem); SPECIAL(0x00160025, spcCloseInventory); + SPECIAL(0x00160030, spcResetCursor); SPECIAL(0x00160032, spcSetCursorField90); SPECIAL(0x00160037, spcIsCursorHoldingObjectId); SPECIAL(0x00160038, spcInitRadarMicrophone); @@ -266,6 +268,12 @@ void BbdouSpecialCode::spcCloseInventory(OpCall &opCall) { _inventory->close(); } +void BbdouSpecialCode::spcResetCursor(OpCall &opCall) { + ARG_UINT32(objectId); + _cursor->reset(objectId); + _vm->notifyThreadId(opCall._threadId); +} + void BbdouSpecialCode::spcSetCursorField90(OpCall &opCall) { ARG_SKIP(4); // objectId unused _cursor->_data._field90 = 1; diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h index 2462c2b172..6ffde37072 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.h +++ b/engines/illusions/bbdou/bbdou_specialcode.h @@ -119,6 +119,7 @@ public: void spcRemoveInventoryItem(OpCall &opCall); void spcHasInventoryItem(OpCall &opCall); void spcCloseInventory(OpCall &opCall); + void spcResetCursor(OpCall &opCall); void spcSetCursorField90(OpCall &opCall); void spcIsCursorHoldingObjectId(OpCall &opCall); void spcInitRadarMicrophone(OpCall &opCall); -- cgit v1.2.3