diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/illusions/duckman/duckman_specialcode.cpp | 15 | ||||
-rw-r--r-- | engines/illusions/duckman/duckman_specialcode.h | 3 | ||||
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.cpp | 12 | ||||
-rw-r--r-- | engines/illusions/duckman/scriptopcodes_duckman.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/input.cpp | 3 | ||||
-rw-r--r-- | engines/illusions/input.h | 1 | ||||
-rw-r--r-- | engines/illusions/screentext.cpp | 3 | ||||
-rw-r--r-- | engines/illusions/sequenceopcodes.cpp | 11 | ||||
-rw-r--r-- | engines/illusions/sequenceopcodes.h | 1 | ||||
-rw-r--r-- | engines/illusions/threads/talkthread_duckman.cpp | 2 |
10 files changed, 38 insertions, 15 deletions
diff --git a/engines/illusions/duckman/duckman_specialcode.cpp b/engines/illusions/duckman/duckman_specialcode.cpp index b23cc44966..6b67f1214f 100644 --- a/engines/illusions/duckman/duckman_specialcode.cpp +++ b/engines/illusions/duckman/duckman_specialcode.cpp @@ -67,6 +67,7 @@ void DuckmanSpecialCode::init() { SPECIAL(0x0016000F, spcUpdateTeleporterPosition); SPECIAL(0x00160010, spcCenterNewspaper); SPECIAL(0x00160012, spcStopScreenShaker); + SPECIAL(0x00160013, spcIncrCounter); SPECIAL(0x00160014, spcUpdateObject272Sequence); SPECIAL(0x0016001C, spcSetCursorInventoryMode); SPECIAL(0x0016001D, spcCenterCurrentScreenText); @@ -226,6 +227,20 @@ void DuckmanSpecialCode::spcStopScreenShaker(OpCall &opCall) { _vm->notifyThreadId(opCall._threadId); } +void DuckmanSpecialCode::spcIncrCounter(OpCall &opCall) { + ARG_BYTE(maxCount); + ARG_BYTE(incr); + _vm->_scriptResource->_properties.set(0x000E0088, false); + if (incr) { + _counter += incr; + if (_counter >= maxCount) + _vm->_scriptResource->_properties.set(0x000E0088, true); + } else { + _counter = 0; + } + _vm->notifyThreadId(opCall._threadId); +} + void DuckmanSpecialCode::spcUpdateObject272Sequence(OpCall &opCall) { byte flags = 0; uint32 sequenceId; diff --git a/engines/illusions/duckman/duckman_specialcode.h b/engines/illusions/duckman/duckman_specialcode.h index 2d05da4dbc..b8bf79c929 100644 --- a/engines/illusions/duckman/duckman_specialcode.h +++ b/engines/illusions/duckman/duckman_specialcode.h @@ -55,6 +55,8 @@ public: PropertyTimers *_propertyTimers; DuckmanInventory *_inventory; + + int16 _counter; // Special code interface functions void runSpecialCode(uint32 specialCodeId, OpCall &opCall); @@ -72,6 +74,7 @@ public: void spcUpdateTeleporterPosition(OpCall &opCall); void spcCenterNewspaper(OpCall &opCall); void spcStopScreenShaker(OpCall &opCall); + void spcIncrCounter(OpCall &opCall); void spcUpdateObject272Sequence(OpCall &opCall); void spcSetCursorInventoryMode(OpCall &opCall); void spcCenterCurrentScreenText(OpCall &opCall); diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp index e4c11bc355..4f21e6bb17 100644 --- a/engines/illusions/duckman/illusions_duckman.cpp +++ b/engines/illusions/duckman/illusions_duckman.cpp @@ -289,7 +289,8 @@ void IllusionsEngine_Duckman::startScreenShaker(uint pointsCount, uint32 duratio } void IllusionsEngine_Duckman::stopScreenShaker() { - _screenShaker->_finished = true; + if (_screenShaker) + _screenShaker->_finished = true; } int IllusionsEngine_Duckman::updateScreenShaker(uint flags) { @@ -892,8 +893,6 @@ void IllusionsEngine_Duckman::updateGameState2() { _cursor._control->_actor->_position = cursorPos; - debug("IllusionsEngine_Duckman::updateGameState2() #1"); - foundOverlapped = _controls->getOverlappedObject(_cursor._control, convMousePos, &overlappedControl, 0); if (cursorPos.y < 8 && !_camera->isAtPanLimit(1)) { @@ -913,7 +912,6 @@ void IllusionsEngine_Duckman::updateGameState2() { startCursorSequence(); } - debug("IllusionsEngine_Duckman::updateGameState2() #2"); if (trackCursorIndex >= 0) { if (_cursor._actorIndex != 10 && _cursor._actorIndex != 11 && _cursor._actorIndex != 12 && _cursor._actorIndex != 13 && _cursor._actorIndex != 3) _cursor._savedActorIndex = _cursor._actorIndex; @@ -926,7 +924,6 @@ void IllusionsEngine_Duckman::updateGameState2() { foundOverlapped = false; } - debug("IllusionsEngine_Duckman::updateGameState2() #3"); if (foundOverlapped) { if (_cursor._currOverlappedControl != overlappedControl) { int cursorValue2 = 0; @@ -952,9 +949,7 @@ void IllusionsEngine_Duckman::updateGameState2() { _cursor._currOverlappedControl = 0; } - debug("IllusionsEngine_Duckman::updateGameState2() #4"); if (_input->pollEvent(kEventLeftClick)) { - debug("IllusionsEngine_Duckman::updateGameState2() #5"); if (_cursor._currOverlappedControl) { runTriggerCause(_cursor._actorIndex, _cursor._objectId, _cursor._currOverlappedControl->_objectId); } else { @@ -966,7 +961,6 @@ void IllusionsEngine_Duckman::updateGameState2() { runTriggerCause(_cursor._actorIndex, _cursor._objectId, 0x40003); } } else if (_input->pollEvent(kEventRightClick)) { - debug("IllusionsEngine_Duckman::updateGameState2() #6"); if (_cursor._actorIndex != 3 && _cursor._actorIndex != 10 && _cursor._actorIndex != 11 && _cursor._actorIndex != 12 && _cursor._actorIndex != 13) { int newActorIndex = getCursorActorIndex(); if (newActorIndex != _cursor._actorIndex) { @@ -979,14 +973,12 @@ void IllusionsEngine_Duckman::updateGameState2() { } } } else if (_input->pollEvent(kEventInventory)) { - debug("IllusionsEngine_Duckman::updateGameState2() #7"); if (_cursor._field14[0] == 1) { runTriggerCause(1, 0, _scriptResource->getMainActorObjectId()); } else if (_cursor._field14[1] == 1) { runTriggerCause(2, 0, _scriptResource->getMainActorObjectId()); } } - debug("IllusionsEngine_Duckman::updateGameState2() #XXX"); } diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp index 382a128fe9..60256b972f 100644 --- a/engines/illusions/duckman/scriptopcodes_duckman.cpp +++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp @@ -205,7 +205,7 @@ void ScriptOpcodes_Duckman::opStartTimerThread(ScriptThread *scriptThread, OpCal //duration = 1;//DEBUG Speeds up things //duration = 5; -debug("duration: %d", duration); +//debug("duration: %d", duration); if (isAbortable) _vm->startAbortableTimerThread(duration, opCall._threadId); diff --git a/engines/illusions/input.cpp b/engines/illusions/input.cpp index 37da087543..56ce27a353 100644 --- a/engines/illusions/input.cpp +++ b/engines/illusions/input.cpp @@ -44,6 +44,9 @@ void KeyMap::add(Common::KeyCode key, int mouseButton) { // InputEvent +InputEvent::InputEvent() : _bitMask(0) { +} + InputEvent& InputEvent::setBitMask(uint bitMask) { _bitMask = bitMask; return *this; diff --git a/engines/illusions/input.h b/engines/illusions/input.h index 7d01ea6eec..99560399c3 100644 --- a/engines/illusions/input.h +++ b/engines/illusions/input.h @@ -64,6 +64,7 @@ protected: class InputEvent { public: + InputEvent(); InputEvent& setBitMask(uint bitMask); InputEvent& addKey(Common::KeyCode key); InputEvent& addMouseButton(int mouseButton); diff --git a/engines/illusions/screentext.cpp b/engines/illusions/screentext.cpp index 7c39823dc5..9fa3d4000d 100644 --- a/engines/illusions/screentext.cpp +++ b/engines/illusions/screentext.cpp @@ -90,7 +90,6 @@ bool ScreenText::refreshScreenText(FontResource *font, WidthHeight dimensions, C bool done = textDrawer.wrapText(font, text, &dimensions, offsPt, textFlags, outTextPtr); _surface = _vm->_screen->allocSurface(dimensions._width, dimensions._height); _surface->fillRect(Common::Rect(0, 0, _surface->w, _surface->h), _vm->_screen->getColorKey1()); - debug("ScreenText dimensions (%d, %d)", dimensions._width, dimensions._height); _dimensions = dimensions; textDrawer.drawText(_vm->_screen, _surface, color2, color1); return done; @@ -126,11 +125,9 @@ bool ScreenText::insertText(uint16 *text, uint32 fontId, WidthHeight dimensions, _screenTexts.push_back(screenText); FontResource *font = _vm->_dict->findFont(screenText->_info._fontId); - debug("font: %p", font); bool done = refreshScreenText(font, screenText->_info._dimensions, screenText->_info._offsPt, text, screenText->_info._flags, screenText->_info._color2, screenText->_info._color1, outTextPtr); - debug("font->getColorIndex(): %d", font->getColorIndex()); _vm->_screen->setPaletteEntry(font->getColorIndex(), screenText->_info._colorR, screenText->_info._colorG, screenText->_info._colorB); uint16 *textPart = screenText->_text; diff --git a/engines/illusions/sequenceopcodes.cpp b/engines/illusions/sequenceopcodes.cpp index fe08850732..8d678ebc52 100644 --- a/engines/illusions/sequenceopcodes.cpp +++ b/engines/illusions/sequenceopcodes.cpp @@ -69,6 +69,7 @@ void SequenceOpcodes::initOpcodes() { OPCODE(10, opStartForeignSequence); OPCODE(11, opBeginLoop); OPCODE(12, opNextLoop); + OPCODE(13, opSetActorIndex); OPCODE(14, opSwitchActorIndex); OPCODE(15, opSwitchFacing); OPCODE(16, opAppearActor); @@ -77,9 +78,13 @@ void SequenceOpcodes::initOpcodes() { OPCODE(19, opDisappearForeignActor); OPCODE(20, opSetNamedPointPosition); OPCODE(21, opMoveDelta); + // 22-24 unused in Duckman, CHECKME BBDOU OPCODE(25, opFaceActor); + // 26-27 unused in Duckman, CHECKME BBDOU OPCODE(28, opNotifyThreadId1); OPCODE(29, opSetPathCtrY); + // 30-31 unused in Duckman, CHECKME BBDOU + // TODO OPCODE(32, ); OPCODE(33, opSetPathWalkPoints); OPCODE(34, opDisableAutoScale); OPCODE(35, opSetScale); @@ -90,6 +95,7 @@ void SequenceOpcodes::initOpcodes() { OPCODE(40, opSetPriorityLayer); OPCODE(41, opDisableAutoRegionLayer); OPCODE(42, opSetRegionLayer); + // 43-47 unused in Duckman, CHECKME BBDOU OPCODE(48, opSetPalette); OPCODE(49, opShiftPalette); OPCODE(50, opPlaySound); @@ -213,6 +219,11 @@ void SequenceOpcodes::opNextLoop(Control *control, OpCall &opCall) { } } +void SequenceOpcodes::opSetActorIndex(Control *control, OpCall &opCall) { + ARG_BYTE(actorIndex); + control->setActorIndex(actorIndex); +} + void SequenceOpcodes::opSwitchActorIndex(Control *control, OpCall &opCall) { ARG_INT16(actorIndex); ARG_INT16(jumpOffs); diff --git a/engines/illusions/sequenceopcodes.h b/engines/illusions/sequenceopcodes.h index 4d5cb7ab53..85e5df6c46 100644 --- a/engines/illusions/sequenceopcodes.h +++ b/engines/illusions/sequenceopcodes.h @@ -57,6 +57,7 @@ protected: void opStartForeignSequence(Control *control, OpCall &opCall); void opBeginLoop(Control *control, OpCall &opCall); void opNextLoop(Control *control, OpCall &opCall); + void opSetActorIndex(Control *control, OpCall &opCall); void opSwitchActorIndex(Control *control, OpCall &opCall); void opSwitchFacing(Control *control, OpCall &opCall); void opAppearActor(Control *control, OpCall &opCall); diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp index 5511fc523e..0476c8f41f 100644 --- a/engines/illusions/threads/talkthread_duckman.cpp +++ b/engines/illusions/threads/talkthread_duckman.cpp @@ -311,7 +311,7 @@ static char *debugW2I(byte *wstr) { } int TalkThread_Duckman::insertText() { - debug("%08X %08X [%s]", _threadId, _talkId, debugW2I(_currEntryText)); + debug(0, "%08X %08X [%s]", _threadId, _talkId, debugW2I(_currEntryText)); WidthHeight dimensions; _vm->getDefaultTextDimensions(dimensions); uint16 *outTextPtr; |