[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.305,2.306 script.cpp,1.200,1.201 script_v6.cpp,1.416,1.417 script_v72he.cpp,2.173,2.174 script_v7he.cpp,2.108,2.109 script_v90he.cpp,2.96,2.97

Travis Howell kirben at users.sourceforge.net
Fri Oct 15 22:11:04 CEST 2004


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

Modified Files:
	intern.h script.cpp script_v6.cpp script_v72he.cpp 
	script_v7he.cpp script_v90he.cpp 
Log Message:

Add missing case for HE 90+
Always clear complete local script vars.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.305
retrieving revision 2.306
diff -u -d -r2.305 -r2.306
--- intern.h	13 Oct 2004 10:55:50 -0000	2.305
+++ intern.h	16 Oct 2004 05:10:14 -0000	2.306
@@ -860,6 +860,7 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 	
+	int getWizImageStates(int resnum);
 	void drawWizComplexPolygon(int resnum, int state, int po_x, int po_y, int arg14, int angle, int zoom, const Common::Rect *r);
 	void displayWizComplexImage(const WizParameters *params);
 	void processWizImage(const WizParameters *params);

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- script.cpp	8 Oct 2004 01:07:44 -0000	1.200
+++ script.cpp	16 Oct 2004 05:10:14 -0000	1.201
@@ -126,10 +126,10 @@
 void ScummEngine::initializeLocals(int slot, int *vars) {
 	int i;
 	if (!vars) {
-		for (i = 0; i < 16; i++)
+		for (i = 0; i < 25; i++)
 			vm.localvar[slot][i] = 0;
 	} else {
-		for (i = 0; i < 16; i++)
+		for (i = 0; i < 25; i++)
 			vm.localvar[slot][i] = vars[i];
 	}
 }
@@ -549,7 +549,7 @@
 		}
 
 		if (_heversion >= 72)
-			checkRange(24, 0, var, "Local variable %d out of range(r)");
+			checkRange(25, 0, var, "Local variable %d out of range(r)");
 		else
 			checkRange(20, 0, var, "Local variable %d out of range(r)");
 		return vm.localvar[_currentScript][var];
@@ -628,7 +628,7 @@
 		}
 
 		if (_heversion >= 72)
-			checkRange(24, 0, var, "Local variable %d out of range(w)");
+			checkRange(25, 0, var, "Local variable %d out of range(w)");
 		else
 			checkRange(20, 0, var, "Local variable %d out of range(w)");
 
@@ -706,7 +706,7 @@
 	if (_version <= 2) {
 		redrawV2Inventory();
 	} else {
-		int args[16];
+		int args[24];
 		memset(args, 0, sizeof(args));
 		args[0] = i;
 		if (VAR(VAR_INVENTORY_SCRIPT)) {
@@ -933,7 +933,7 @@
 
 void ScummEngine::checkAndRunSentenceScript() {
 	int i;
-	int localParamList[16];
+	int localParamList[24];
 	const ScriptSlot *ss;
 	int sentenceScript;
 	if (_version <= 2)
@@ -974,7 +974,7 @@
 }
 
 void ScummEngine::runInputScript(int a, int cmd, int mode) {
-	int args[16];
+	int args[24];
 	int verbScript;
 
 	if (_version <= 2) {

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.416
retrieving revision 1.417
diff -u -d -r1.416 -r1.417
--- script_v6.cpp	13 Oct 2004 07:59:51 -0000	1.416
+++ script_v6.cpp	16 Oct 2004 05:10:14 -0000	1.417
@@ -819,7 +819,7 @@
 }
 
 void ScummEngine_v6::o6_startScript() {
-	int args[16];
+	int args[24];
 	int script, flags;
 
 	getStackList(args, ARRAYSIZE(args));
@@ -857,7 +857,7 @@
 }
 
 void ScummEngine_v6::o6_jumpToScript() {
-	int args[16];
+	int args[24];
 	int script, flags;
 
 	getStackList(args, ARRAYSIZE(args));
@@ -868,7 +868,7 @@
 }
 
 void ScummEngine_v6::o6_startScriptQuick() {
-	int args[16];
+	int args[24];
 	int script;
 	getStackList(args, ARRAYSIZE(args));
 	script = pop();
@@ -876,7 +876,7 @@
 }
 
 void ScummEngine_v6::o6_startScriptQuick2() {
-	int args[16];
+	int args[24];
 	int script;
 	getStackList(args, ARRAYSIZE(args));
 	script = pop();
@@ -884,7 +884,7 @@
 }
 
 void ScummEngine_v6::o6_startObject() {
-	int args[16];
+	int args[24];
 	int script, entryp;
 	int flags;
 	getStackList(args, ARRAYSIZE(args));
@@ -895,7 +895,7 @@
 }
 
 void ScummEngine_v6::o6_startObjectQuick() {
-	int args[16];
+	int args[24];
 	int script, entryp;
 	getStackList(args, ARRAYSIZE(args));
 	entryp = pop();
@@ -930,7 +930,7 @@
 }
 
 void ScummEngine_v6::o6_cutscene() {
-	int args[16];
+	int args[24];
 	getStackList(args, ARRAYSIZE(args));
 	beginCutscene(args);
 }

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.173
retrieving revision 2.174
diff -u -d -r2.173 -r2.174
--- script_v72he.cpp	13 Oct 2004 10:55:50 -0000	2.173
+++ script_v72he.cpp	16 Oct 2004 05:10:14 -0000	2.174
@@ -787,7 +787,7 @@
 }
 
 void ScummEngine_v72he::o72_startScript() {
-	int args[16];
+	int args[24];
 	int script;
 	byte flags;
 
@@ -798,7 +798,7 @@
 }
 
 void ScummEngine_v72he::o72_startObject() {
-	int args[16];
+	int args[24];
 	int script, entryp;
 	byte flags;
 
@@ -1871,7 +1871,7 @@
 }
 
 void ScummEngine_v72he::o72_jumpToScript() {
-	int args[16];
+	int args[24];
 	int script;
 	byte flags;
 

Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.108
retrieving revision 2.109
diff -u -d -r2.108 -r2.109
--- script_v7he.cpp	13 Oct 2004 10:55:50 -0000	2.108
+++ script_v7he.cpp	16 Oct 2004 05:10:14 -0000	2.109
@@ -1019,7 +1019,7 @@
 	wp->bound.bottom = -10000;
 
 	// compute bounding box
-	for (int j = 0; j < 5; j++) {
+	for (int j = 0; j < wp->numVerts; j++) {
 		Common::Rect r(wp->vert[j].x, wp->vert[j].y, wp->vert[j].x + 1, wp->vert[j].y + 1);
 		wp->bound.extend(r);
 	}
@@ -1060,7 +1060,7 @@
 }
 
 bool ScummEngine_v70he::polygonContains(const WizPolygon &pol, int x, int y) {
-	int pi = pol.numVerts - 1;
+	int pi = pol.numVerts;
 	bool diry = (y < pol.vert[pi].y);
 	bool curdir;
 	bool r = false;

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.96
retrieving revision 2.97
diff -u -d -r2.96 -r2.97
--- script_v90he.cpp	13 Oct 2004 10:55:50 -0000	2.96
+++ script_v90he.cpp	16 Oct 2004 05:10:15 -0000	2.97
@@ -452,7 +452,7 @@
 }
 
 void ScummEngine_v90he::o90_startScriptUnk() {
-	int args[16];
+	int args[24];
 	int script, cycle;
 	byte flags;
 
@@ -464,7 +464,7 @@
 }
 
 void ScummEngine_v90he::o90_jumpToScriptUnk() {
-	int args[16];
+	int args[24];
 	int script, cycle;
 	byte flags;
 
@@ -1119,6 +1119,26 @@
 	debug(1,"o90_unknown28 stub (%d)", subOp);
 }
 
+int ScummEngine_v90he::getWizImageStates(int resnum) {
+	const uint8 *dataPtr = getResourceAddress(rtImage, resnum);
+	assert(dataPtr);
+	if (READ_UINT32(dataPtr) == MKID('MULT')) {
+		const byte *offs, *wrap;
+
+		wrap = findResource(MKID('WRAP'), dataPtr);
+		if (wrap == NULL)
+			return 1;
+
+		offs = findResourceData(MKID('OFFS'), wrap);
+		if (offs == NULL)
+			return 1;
+
+		return(getResourceDataSize(offs) / 4);
+	} else {
+		return 1;
+	}
+}
+
 void ScummEngine_v90he::o90_unknown29() {
 	int state, resId;
 	uint32 w, h;
@@ -1153,8 +1173,8 @@
 		push(h);
 		break;
 	case 6:
-		pop();
-		push(0);
+		resId = pop();
+		push(getWizImageStates(resId));
 		break;
 	case 15:
 		pop();





More information about the Scummvm-git-logs mailing list