[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.68,2.69 script_v5.cpp,1.49,1.50

Max Horn fingolfin at users.sourceforge.net
Mon Apr 28 07:50:37 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv23256

Modified Files:
	intern.h script_v5.cpp 
Log Message:
added two missing opcodes (well one is just a stub, but anyway :-)

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -d -r2.68 -r2.69
--- intern.h	27 Apr 2003 11:38:38 -0000	2.68
+++ intern.h	28 Apr 2003 14:46:52 -0000	2.69
@@ -92,9 +92,11 @@
 	void o5_getObjectOwner();
 	void o5_getObjectState();
 	void o5_getRandomNr();
-	void o5_isScriptRunning();
+	void o5_getStringWidth();
 	void o5_getVerbEntrypoint();
 	void o5_ifClassOfIs();
+	void o5_ifNotState();
+	void o5_ifState();
 	void o5_increment();
 	void o5_isActorInBox();
 	void o5_isEqual();
@@ -102,8 +104,7 @@
 	void o5_isGreaterEqual();
 	void o5_isLess();
 	void o5_isNotEqual();
-	void o5_ifState();
-	void o5_ifNotState();
+	void o5_isScriptRunning();
 	void o5_isSoundRunning();
 	void o5_jumpRelative();
 	void o5_lessOrEqual();
@@ -114,10 +115,12 @@
 	void o5_move();
 	void o5_multiply();
 	void o5_notEqualZero();
+	void o5_oldRoomEffect();
 	void o5_or();
 	void o5_overRide();
 	void o5_panCameraTo();
 	void o5_pickupObject();
+	void o5_pickupObjectOld();
 	void o5_print();
 	void o5_printEgo();
 	void o5_pseudoRoom();
@@ -127,6 +130,7 @@
 	void o5_quitPauseRestart();
 	void o5_resourceRoutines();
 	void o5_roomOps();
+	void o5_saveLoadVars();
 	void o5_saveRestoreVerbs();
 	void o5_setCameraAt();
 	void o5_setClass();
@@ -151,8 +155,6 @@
 	void o5_walkActorTo();
 	void o5_walkActorToActor();
 	void o5_walkActorToObject();
-	void o5_oldRoomEffect();
-	void o5_pickupObjectOld();
 };
 
 // FIXME - maybe we should move the opcodes from v5 to v3, and change the inheritance 

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- script_v5.cpp	28 Apr 2003 03:13:47 -0000	1.49
+++ script_v5.cpp	28 Apr 2003 14:46:55 -0000	1.50
@@ -161,7 +161,7 @@
 		OPCODE(o5_loadRoomWithEgo),
 		OPCODE(o5_pickupObject),
 		OPCODE(o5_getClosestObjActor),
-		OPCODE(o5_dummy),
+		OPCODE(o5_getStringWidth),
 		/* 68 */
 		OPCODE(o5_isScriptRunning),
 		OPCODE(o5_setOwnerOf),
@@ -241,7 +241,7 @@
 		OPCODE(o5_loadRoomWithEgo),
 		OPCODE(o5_pickupObject),
 		OPCODE(o5_setVarRange),
-		OPCODE(o5_dummy),
+		OPCODE(o5_saveLoadVars),
 		/* A8 */
 		OPCODE(o5_notEqualZero),
 		OPCODE(o5_setOwnerOf),
@@ -321,7 +321,7 @@
 		OPCODE(o5_loadRoomWithEgo),
 		OPCODE(o5_pickupObject),
 		OPCODE(o5_getClosestObjActor),
-		OPCODE(o5_dummy),
+		OPCODE(o5_getStringWidth),
 		/* E8 */
 		OPCODE(o5_isScriptRunning),
 		OPCODE(o5_setOwnerOf),
@@ -792,8 +792,26 @@
 	putState(obj, state);
 }
 
+void Scumm_v5::o5_getStringWidth() {
+	// TODO - not sure if this is correct... needs testing
+	int a = getVarOrDirectByte(0x80);
+	byte *ptr = getResourceAddress(rtString, a);
+	int width = 0;
+	
+	if (ptr)
+		width = _charset->getStringWidth(0, ptr);
+	
+	setResult(width);
+	warning("o5_getStringWidth, result %d\n", width);
+}
+
+void Scumm_v5::o5_saveLoadVars() {
+	// TODO
+	error("o5_saveLoadVars not yet implemented");
+}
+
 void Scumm_v5::o5_dummy() {
-	/* nothing */
+	warning("o5_dummy invoked (opcode %d)", _opcode);
 }
 
 void Scumm_v5::o5_expression() {
@@ -1811,6 +1829,8 @@
 		checkRange(16, 1, a, "o5_roomOps: 16: color cycle out of range (%d)");
 		_colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0;
 		break;
+	default:
+		error("o5_roomOps: unknown subopcode %d\n", _opcode & 0x1F);
 	}
 }
 





More information about the Scummvm-git-logs mailing list