[Scummvm-cvs-logs] SF.net SVN: scummvm: [32769] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Tue Jun 24 22:44:37 CEST 2008


Revision: 32769
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32769&view=rev
Author:   buddha_
Date:     2008-06-24 13:44:37 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/object.cpp
    scummvm/trunk/engines/cine/object.h
    scummvm/trunk/engines/cine/script.h
    scummvm/trunk/engines/cine/script_os.cpp

Modified: scummvm/trunk/engines/cine/object.cpp
===================================================================
--- scummvm/trunk/engines/cine/object.cpp	2008-06-24 19:48:01 UTC (rev 32768)
+++ scummvm/trunk/engines/cine/object.cpp	2008-06-24 20:44:37 UTC (rev 32769)
@@ -122,24 +122,22 @@
  * \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 @@
  * \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;
 		}

Modified: scummvm/trunk/engines/cine/object.h
===================================================================
--- scummvm/trunk/engines/cine/object.h	2008-06-24 19:48:01 UTC (rev 32768)
+++ scummvm/trunk/engines/cine/object.h	2008-06-24 20:44:37 UTC (rev 32769)
@@ -62,8 +62,8 @@
 
 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);
 

Modified: scummvm/trunk/engines/cine/script.h
===================================================================
--- scummvm/trunk/engines/cine/script.h	2008-06-24 19:48:01 UTC (rev 32768)
+++ scummvm/trunk/engines/cine/script.h	2008-06-24 20:44:37 UTC (rev 32769)
@@ -258,10 +258,10 @@
 	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();
 

Modified: scummvm/trunk/engines/cine/script_os.cpp
===================================================================
--- scummvm/trunk/engines/cine/script_os.cpp	2008-06-24 19:48:01 UTC (rev 32768)
+++ scummvm/trunk/engines/cine/script_os.cpp	2008-06-24 20:44:37 UTC (rev 32769)
@@ -240,10 +240,10 @@
 	{ &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 @@
 	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;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list