aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKari Salminen2008-06-24 20:44:37 +0000
committerKari Salminen2008-06-24 20:44:37 +0000
commitf1cacafc466ac8689a286d1e712f0ada67e9a994 (patch)
tree824a05a226eedfe4ec05d1bc86944a0f4c7e9e0d
parenteb598b77baaaf54de5e39b226e47567e0db23ae9 (diff)
downloadscummvm-rg350-f1cacafc466ac8689a286d1e712f0ada67e9a994.tar.gz
scummvm-rg350-f1cacafc466ac8689a286d1e712f0ada67e9a994.tar.bz2
scummvm-rg350-f1cacafc466ac8689a286d1e712f0ada67e9a994.zip
Fixed opcodes:
- 0xA0: o2_addGfxElementType20 (Was o2_addGfxElementA0) Implemented opcodes: - 0xA1: o2_removeGfxElementType20 (Was o2_removeGfxElementA0) - 0xA2: o2_addGfxElementType21 (Was o2_opA2) - 0xA3: o2_removeGfxElementType21 (Was o2_opA3) NOTE: Drawing of type 21 overlay elements isn't coded yet. svn-id: r32769
-rw-r--r--engines/cine/object.cpp14
-rw-r--r--engines/cine/object.h4
-rw-r--r--engines/cine/script.h8
-rw-r--r--engines/cine/script_os.cpp38
4 files changed, 28 insertions, 36 deletions
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index 7666f05352..96048f5214 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -122,24 +122,22 @@ void addOverlay(uint16 objIdx, uint16 param) {
* \param objIdx Associate the overlay with this object
* \param param source background index
*/
-void addGfxElementA0(int16 objIdx, int16 param) {
+void addGfxElement(int16 objIdx, int16 param, int16 type) {
Common::List<overlay>::iterator it;
overlay tmp;
for (it = overlayList.begin(); it != overlayList.end(); ++it) {
- // wtf?!
- if (objectTable[it->objIdx].mask == objectTable[objIdx].mask &&
- (it->type == 2 || it->type == 3)) {
+ if (objectTable[it->objIdx].mask >= objectTable[objIdx].mask || it->type == 2 || it->type == 3) {
break;
}
}
- if (it != overlayList.end() && it->objIdx == objIdx && it->type == 20 && it->x == param) {
+ if (it != overlayList.end() && it->objIdx == objIdx && it->type == type && it->x == param) {
return;
}
tmp.objIdx = objIdx;
- tmp.type = 20;
+ tmp.type = type;
tmp.x = param;
tmp.y = 0;
tmp.width = 0;
@@ -153,11 +151,11 @@ void addGfxElementA0(int16 objIdx, int16 param) {
* \param param Remove overlay using this background
* \todo Check that it works
*/
-void removeGfxElementA0(int16 objIdx, int16 param) {
+void removeGfxElement(int16 objIdx, int16 param, int16 type) {
Common::List<overlay>::iterator it;
for (it = overlayList.begin(); it != overlayList.end(); ++it) {
- if (it->objIdx == objIdx && it->type == 20 && it->x == param) {
+ if (it->objIdx == objIdx && it->type == type && it->x == param) {
overlayList.erase(it);
return;
}
diff --git a/engines/cine/object.h b/engines/cine/object.h
index e7de39649d..6252a628cb 100644
--- a/engines/cine/object.h
+++ b/engines/cine/object.h
@@ -62,8 +62,8 @@ void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue);
void addOverlay(uint16 objIdx, uint16 param);
int removeOverlay(uint16 objIdx, uint16 param);
-void addGfxElementA0(int16 objIdx, int16 param);
-void removeGfxElementA0(int16 objIdx, int16 param);
+void addGfxElement(int16 objIdx, int16 param, int16 type);
+void removeGfxElement(int16 objIdx, int16 param, int16 type);
int16 getObjectParam(uint16 objIdx, uint16 paramIdx);
diff --git a/engines/cine/script.h b/engines/cine/script.h
index eeac0e8809..2b6acbba9b 100644
--- a/engines/cine/script.h
+++ b/engines/cine/script.h
@@ -258,10 +258,10 @@ protected:
int o2_useBgScroll();
int o2_setAdditionalBgVScroll();
int o2_op9F();
- int o2_addGfxElementA0();
- int o2_removeGfxElementA0();
- int o2_opA2();
- int o2_opA3();
+ int o2_addGfxElementType20();
+ int o2_removeGfxElementType20();
+ int o2_addGfxElementType21();
+ int o2_removeGfxElementType21();
int o2_loadMask22();
int o2_unloadMask22();
diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp
index 319fca5d3c..ffc0da5790 100644
--- a/engines/cine/script_os.cpp
+++ b/engines/cine/script_os.cpp
@@ -240,10 +240,10 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o2_setAdditionalBgVScroll, "c" },
{ &FWScript::o2_op9F, "ww" }, /* TODO: Name this opcode properly. */
/* A0 */
- { &FWScript::o2_addGfxElementA0, "ww" }, /* TODO: Name this opcode properly. */
- { &FWScript::o2_removeGfxElementA0, "ww" }, /* TODO: Name this opcode properly. */
- { &FWScript::o2_opA2, "ww" }, /* TODO: Name this opcode properly. */
- { &FWScript::o2_opA3, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_addGfxElementType20, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_removeGfxElementType20, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_addGfxElementType21, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_removeGfxElementType21, "ww" }, /* TODO: Name this opcode properly. */
/* A4 */
{ &FWScript::o2_loadMask22, "b" }, /* TODO: Name this opcode properly. */
{ &FWScript::o2_unloadMask22, "b" }, /* TODO: Name this opcode properly. */
@@ -721,42 +721,36 @@ int FWScript::o2_op9F() {
return 0;
}
-int FWScript::o2_addGfxElementA0() {
+int FWScript::o2_addGfxElementType20() {
uint16 param1 = getNextWord();
uint16 param2 = getNextWord();
- debugC(5, kCineDebugScript, "Line: %d: addGfxElementA0(%d,%d)", _line, param1, param2);
- addGfxElementA0(param1, param2);
+ debugC(5, kCineDebugScript, "Line: %d: o2_addGfxElementType20(%d,%d)", _line, param1, param2);
+ addGfxElement(param1, param2, 20);
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o2_removeGfxElementA0() {
+int FWScript::o2_removeGfxElementType20() {
uint16 idx = getNextWord();
uint16 param = getNextWord();
- warning("STUB? o2_removeGfxElementA0(%x, %x)", idx, param);
- removeGfxElementA0(idx, param);
+ debugC(5, kCineDebugScript, "Line: %d: o2_removeGfxElementType20(%d,%d)", _line, idx, param);
+ removeGfxElement(idx, param, 20);
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o2_opA2() {
+int FWScript::o2_addGfxElementType21() {
uint16 a = getNextWord();
uint16 b = getNextWord();
- warning("STUB: o2_opA2(%x, %x)", a, b);
- // addGfxElementA2();
+ debugC(5, kCineDebugScript, "Line: %d: o2_addGfxElementType21(%d,%d)", _line, a, b);
+ addGfxElement(a, b, 21);
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o2_opA3() {
+int FWScript::o2_removeGfxElementType21() {
uint16 a = getNextWord();
uint16 b = getNextWord();
- warning("STUB: o2_opA3(%x, %x)", a, b);
- // removeGfxElementA2();
+ debugC(5, kCineDebugScript, "Line: %d: o2_removeGfxElementType21(%d,%d)", _line, a, b);
+ removeGfxElement(a, b, 21);
return 0;
}