aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/duckman
diff options
context:
space:
mode:
authorjohndoe1232015-12-02 16:52:05 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit11ec6d2258353cca43ae8a43085a1565e896e1e9 (patch)
treebc437d928efb2cc53c819b26022009f29098d059 /engines/illusions/duckman
parentd16ebff3901b3731ec48d6dfda6b91acbdb11ff5 (diff)
downloadscummvm-rg350-11ec6d2258353cca43ae8a43085a1565e896e1e9.tar.gz
scummvm-rg350-11ec6d2258353cca43ae8a43085a1565e896e1e9.tar.bz2
scummvm-rg350-11ec6d2258353cca43ae8a43085a1565e896e1e9.zip
ILLUSIONS: DUCKMAN: Implement special opcode 160013, also fix Input and reduce debug output
Diffstat (limited to 'engines/illusions/duckman')
-rw-r--r--engines/illusions/duckman/duckman_specialcode.cpp15
-rw-r--r--engines/illusions/duckman/duckman_specialcode.h3
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp12
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.cpp2
4 files changed, 21 insertions, 11 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);