aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232015-11-30 17:07:59 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitf692e0acfbe1e0a2266502348da7576a0c4f89a1 (patch)
tree2921fe424ec72880b298a2580fc1edf925574632 /engines
parent9c0ef1bb11508f15bd4e5b710ccbbba6dfa5341e (diff)
downloadscummvm-rg350-f692e0acfbe1e0a2266502348da7576a0c4f89a1.tar.gz
scummvm-rg350-f692e0acfbe1e0a2266502348da7576a0c4f89a1.tar.bz2
scummvm-rg350-f692e0acfbe1e0a2266502348da7576a0c4f89a1.zip
ILLUSIONS: DUCKMAN: Implement special opcodes 16001D, 16001E, 16001F and related code
Diffstat (limited to 'engines')
-rw-r--r--engines/illusions/duckman/duckman_specialcode.cpp39
-rw-r--r--engines/illusions/duckman/duckman_specialcode.h5
-rw-r--r--engines/illusions/illusions.cpp16
-rw-r--r--engines/illusions/illusions.h1
4 files changed, 52 insertions, 9 deletions
diff --git a/engines/illusions/duckman/duckman_specialcode.cpp b/engines/illusions/duckman/duckman_specialcode.cpp
index d0d8a5c798..4cb20fc4b0 100644
--- a/engines/illusions/duckman/duckman_specialcode.cpp
+++ b/engines/illusions/duckman/duckman_specialcode.cpp
@@ -3,7 +3,7 @@
* 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
@@ -66,6 +66,9 @@ void DuckmanSpecialCode::init() {
SPECIAL(0x00160010, spcCenterNewspaper);
SPECIAL(0x00160014, spcUpdateObject272Sequence);
SPECIAL(0x0016001C, spcSetCursorInventoryMode);
+ SPECIAL(0x0016001D, spcCenterCurrentScreenText);
+ SPECIAL(0x0016001E, spcSetDefaultTextCoords);
+ SPECIAL(0x0016001F, spcSetTextDuration);
}
#undef SPECIAL
@@ -157,13 +160,6 @@ void DuckmanSpecialCode::spcCenterNewspaper(OpCall &opCall) {
_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;
@@ -206,4 +202,31 @@ void DuckmanSpecialCode::spcUpdateObject272Sequence(OpCall &opCall) {
control->startSequenceActor(sequenceId, 2, opCall._threadId);
}
+void DuckmanSpecialCode::spcSetCursorInventoryMode(OpCall &opCall) {
+ ARG_BYTE(mode);
+ ARG_BYTE(value);
+ _vm->setCursorInventoryMode(mode, value);
+ _vm->notifyThreadId(opCall._threadId);
+}
+
+void DuckmanSpecialCode::spcCenterCurrentScreenText(OpCall &opCall) {
+ WidthHeight dimensions;
+ _vm->getDefaultTextDimensions(dimensions);
+ Common::Point pt(160, dimensions._height / 2 + 8);
+ _vm->setDefaultTextPosition(pt);
+ _vm->notifyThreadId(opCall._threadId);
+}
+
+void DuckmanSpecialCode::spcSetDefaultTextCoords(OpCall &opCall) {
+ _vm->setDefaultTextCoords();
+ _vm->notifyThreadId(opCall._threadId);
+}
+
+void DuckmanSpecialCode::spcSetTextDuration(OpCall &opCall) {
+ ARG_INT16(kind);
+ ARG_INT16(duration);
+ _vm->setTextDuration(kind, duration);
+ _vm->notifyThreadId(opCall._threadId);
+}
+
} // End of namespace Illusions
diff --git a/engines/illusions/duckman/duckman_specialcode.h b/engines/illusions/duckman/duckman_specialcode.h
index 53012d68cd..c4dfc3698c 100644
--- a/engines/illusions/duckman/duckman_specialcode.h
+++ b/engines/illusions/duckman/duckman_specialcode.h
@@ -67,8 +67,11 @@ public:
void spcSetPropertyTimer(OpCall &opCall);
void spcRemovePropertyTimer(OpCall &opCall);
void spcCenterNewspaper(OpCall &opCall);
- void spcSetCursorInventoryMode(OpCall &opCall);
void spcUpdateObject272Sequence(OpCall &opCall);
+ void spcSetCursorInventoryMode(OpCall &opCall);
+ void spcCenterCurrentScreenText(OpCall &opCall);
+ void spcSetDefaultTextCoords(OpCall &opCall);
+ void spcSetTextDuration(OpCall &opCall);
};
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index dbc07724d5..c4af5b5449 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -303,6 +303,22 @@ bool IllusionsEngine::checkActiveTalkThreads() {
return _threads->isActiveThread(kMsgQueryTalkThreadActive);
}
+void IllusionsEngine::setTextDuration(int kind, uint32 duration) {
+ _field8 = kind;
+ switch (_field8) {
+ case 1:
+ case 2:
+ _fieldA = 0;
+ break;
+ case 3:
+ case 4:
+ _fieldA = duration;
+ break;
+ default:
+ break;
+ }
+}
+
uint32 IllusionsEngine::clipTextDuration(uint32 duration) {
switch (_field8) {
case 2:
diff --git a/engines/illusions/illusions.h b/engines/illusions/illusions.h
index f188d5cee3..9914936add 100644
--- a/engines/illusions/illusions.h
+++ b/engines/illusions/illusions.h
@@ -170,6 +170,7 @@ public:
void setCurrFontId(uint32 fontId);
bool checkActiveTalkThreads();
+ void setTextDuration(int kind, uint32 duration);
uint32 clipTextDuration(uint32 duration);
void getDefaultTextDimensions(WidthHeight &dimensions);
void setDefaultTextDimensions(WidthHeight &dimensions);