aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKari Salminen2008-06-25 17:14:44 +0000
committerKari Salminen2008-06-25 17:14:44 +0000
commitd5d09208b4a03eb55697d8831bf87ba8a43385ec (patch)
treedf4b2e1e6c48b60efc4ca6016af809cc7a9f2444
parenta2e6f35310b7f4fc4f4a1aa6ca3d5e7ab618b85d (diff)
downloadscummvm-rg350-d5d09208b4a03eb55697d8831bf87ba8a43385ec.tar.gz
scummvm-rg350-d5d09208b4a03eb55697d8831bf87ba8a43385ec.tar.bz2
scummvm-rg350-d5d09208b4a03eb55697d8831bf87ba8a43385ec.zip
Implemented opcode:
- 0x82: o2_modifySeqListElement (Was o2_op82) Seeks a matching element from the seqList and modifies its values. svn-id: r32786
-rw-r--r--engines/cine/script.h2
-rw-r--r--engines/cine/script_os.cpp10
-rw-r--r--engines/cine/various.cpp13
-rw-r--r--engines/cine/various.h1
4 files changed, 20 insertions, 6 deletions
diff --git a/engines/cine/script.h b/engines/cine/script.h
index 2b6acbba9b..fcd21990fa 100644
--- a/engines/cine/script.h
+++ b/engines/cine/script.h
@@ -237,7 +237,7 @@ protected:
int o2_playSample();
int o2_playSampleAlt();
int o2_op81();
- int o2_op82();
+ int o2_modifySeqListElement();
int o2_isSeqRunning();
int o2_gotoIfSupNearest();
int o2_gotoIfSupEquNearest();
diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp
index 09ab5188a0..5c6be12ab0 100644
--- a/engines/cine/script_os.cpp
+++ b/engines/cine/script_os.cpp
@@ -202,7 +202,7 @@ const Opcode OSScript::_opcodeTable[] = {
/* 80 */
{ &FWScript::o2_removeSeq, "bb" },
{ &FWScript::o2_op81, "" }, /* TODO: Name this opcode properly. */
- { &FWScript::o2_op82, "bbwwb" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_modifySeqListElement, "bbwwb" },
{ &FWScript::o2_isSeqRunning, "bb" },
/* 84 */
{ &FWScript::o2_gotoIfSupNearest, "b" },
@@ -449,15 +449,15 @@ int FWScript::o2_op81() {
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o2_op82() {
+int FWScript::o2_modifySeqListElement() {
byte a = getNextByte();
byte b = getNextByte();
uint16 c = getNextWord();
uint16 d = getNextWord();
byte e = getNextByte();
- warning("STUB: o2_op82(%x, %x, %x, %x, %x)", a, b, c, d, e);
+ debugC(5, kCineDebugScript, "Line: %d: o2_modifySeqListElement(%d,%d,%d,%d,%d)", _line, a, b, c, d, e);
+
+ modifySeqListElement(a, 0, b, c, d, e);
return 0;
}
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 9b98ddb253..f39ae4fb35 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -1618,6 +1618,19 @@ void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, i
seqList.insert(it, tmp);
}
+void modifySeqListElement(uint16 objIdx, int16 var4Test, int16 param1, int16 param2, int16 param3, int16 param4) {
+ // Find a suitable list element and modify it
+ for (Common::List<SeqListElement>::iterator it = seqList.begin(); it != seqList.end(); ++it) {
+ if (it->objIdx == objIdx && it->var4 == var4Test) {
+ it->varC = param1;
+ it->var18 = param2;
+ it->var1A = param3;
+ it->var10 = it->var12 = param4;
+ break;
+ }
+ }
+}
+
void computeMove1(SeqListElement &element, int16 x, int16 y, int16 param1,
int16 param2, int16 x2, int16 y2) {
element.var16 = 0;
diff --git a/engines/cine/various.h b/engines/cine/various.h
index 91662c16ff..17b11bf72a 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -138,6 +138,7 @@ void removeMessages();
void removeSeq(uint16 param1, uint16 param2, uint16 param3);
uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3);
void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8);
+void modifySeqListElement(uint16 objIdx, int16 var4Test, int16 param1, int16 param2, int16 param3, int16 param4);
void processSeqList(void);
bool makeTextEntryMenu(const char *caption, char *string, int strLen, int y);