[Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,2.13,2.14

Eugene Sandulenko sev at users.sourceforge.net
Fri Jun 4 19:21:04 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20384

Modified Files:
	script_v7he.cpp 
Log Message:
Implement o7_readINI(), well, we pretend that we don't have .ini file.
Fix bug in stringLen() function.


Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -d -r2.13 -r2.14
--- script_v7he.cpp	3 Jun 2004 01:28:21 -0000	2.13
+++ script_v7he.cpp	5 Jun 2004 02:20:40 -0000	2.14
@@ -386,6 +386,10 @@
 
 
 void ScummEngine_v7he::o7_objectX() {
+	if (_heversion <= 71) {
+		o6_invalid();
+	}
+
 	int object = pop();
 	int objnum = getObjectIndex(object);
 
@@ -399,6 +403,10 @@
 
 
 void ScummEngine_v7he::o7_objectY() {
+	if (_heversion <= 71) {
+		o6_invalid();
+	}
+
 	int object = pop();
 	int objnum = getObjectIndex(object);
 
@@ -453,7 +461,7 @@
 	c = *ptr++;
 
 	if (len == c)
-		return 1;
+		return 0;
 
 	do {
 		len++;
@@ -464,18 +472,32 @@
 		c = *ptr++;
 	} while (c);
 
-	return len+1;
+	return len;
 }
 
 void ScummEngine_v7he::o7_readINI() {
 	int len;
+	int type;
+	int retval;
 
+	// we pretend that we don't have .ini file
 	len = resStrLen(_scriptPointer);
-	debug(1, "stub o7_readINI(\"%s\")", _scriptPointer);
 	_scriptPointer += len + 1;
-	pop();
-	push(0);
-	
+	type = pop();
+
+	switch (type) {
+	case 1: // number
+		push(0);
+		break;
+	case 2: // string
+		defineArray(0, 4, 0, 0);
+		retval = readVar(0);
+		writeArray(0, 0, 0, 0);
+		push(retval); // var ID string
+		break;
+	default:
+		warning("o7_readINI(..., %d): read-ini string not implemented", type);
+	}
 }
 
 void ScummEngine_v7he::o7_unknownF4() {





More information about the Scummvm-git-logs mailing list