[Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.82,1.83 script_v2.cpp,2.69,2.70

Max Horn fingolfin at users.sourceforge.net
Thu May 15 18:57:02 CEST 2003


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

Modified Files:
	script.cpp script_v2.cpp 
Log Message:
hackish partial doSentence support

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- script.cpp	15 May 2003 23:50:16 -0000	1.82
+++ script.cpp	16 May 2003 01:56:06 -0000	1.83
@@ -848,7 +848,9 @@
 	objptr = getOBCDFromObject(obj);
 	assert(objptr);
 
-	if (_features & GF_OLD_BUNDLE)
+	if (_features & GF_AFTER_V2)
+		verbptr = objptr + 15;
+	else if (_features & GF_OLD_BUNDLE)
 		verbptr = objptr + 17;
 	else if (_features & GF_SMALL_HEADER)
 		verbptr = objptr + 19;

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.69
retrieving revision 2.70
diff -u -d -r2.69 -r2.70
--- script_v2.cpp	14 May 2003 20:37:53 -0000	2.69
+++ script_v2.cpp	16 May 2003 01:56:06 -0000	2.70
@@ -357,6 +357,8 @@
 	_opcodesV2 = opcodes;
 }
 
+#define SENTENCE_SCRIPT 2
+
 void Scumm_v2::executeOpcode(byte i) {
 	OpcodeProcV2 op = _opcodesV2[i].proc;
 	(this->*op) ();
@@ -634,7 +636,7 @@
 }
 
 void Scumm_v2::o2_waitForSentence() {
-	if (_sentenceNum && !isScriptInUse(2))
+	if (_sentenceNum && !isScriptInUse(SENTENCE_SCRIPT))
 		return;
 
 	_scriptPointer--;
@@ -828,7 +830,7 @@
 	a = getVarOrDirectByte(0x80);
 	if (a == 0xFB) {
 		_sentenceNum = 0;
-		stopScriptNr(2);
+		stopScriptNr(SENTENCE_SCRIPT);
 		clearClickedStatus();
 		return;
 	}
@@ -848,16 +850,29 @@
 	// TODO
 	switch(fetchScriptByte()) {
 	case 1:
-		// TODO - execute the sentence
+		// Execute the sentence
 		_sentenceNum--;
+		warning("TODO o2_doSentence(%d, %d, %d): execute", st->verb, st->unk4, st->unk3);
+
+		// FIXME / TODO: The following is hackish, and probably incomplete, but it works somewhat.
+		_scummVars[8] = st->verb;
+		_scummVars[9] = st->unk4;
+		_scummVars[10] = st->unk3;
+		runVerbCode(st->unk4, st->verb, 0, 0, NULL);
+
 		break;
 	case 2:
 		// TODO - print the sentence
 		_sentenceNum--;
+		warning("TODO o2_doSentence(%d, %d, %d): print", st->verb, st->unk4, st->unk3);
 		break;
 	}
 }
 
+void Scumm_v2::o2_drawSentence() {
+	warning("TODO o2_drawSentence()");
+}
+
 void Scumm_v2::o2_ifClassOfIs() {
 	int act = getVarOrDirectWord(0x80);
 	int clsop = getVarOrDirectByte(0x40);
@@ -1194,10 +1209,6 @@
 		setResult(a->walkbox);
 	else
 		setResult(0);
-}
-
-void Scumm_v2::o2_drawSentence() {
-	warning("TODO o2_drawSentence()");
 }
 
 void Scumm_v2::o2_dummy() {





More information about the Scummvm-git-logs mailing list