[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.268,2.269 script.cpp,1.196,1.197 script_v6he.cpp,2.125,2.126 scumm.cpp,1.226,1.227 scumm.h,1.494,1.495

Travis Howell kirben at users.sourceforge.net
Wed Sep 22 22:03:01 CEST 2004


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

Modified Files:
	intern.h script.cpp script_v6he.cpp scumm.cpp scumm.h 
Log Message:

Fix array pointer overflows in HE80+ games.
Some arrays are nuked in startScene.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.268
retrieving revision 2.269
diff -u -d -r2.268 -r2.269
--- intern.h	22 Sep 2004 00:22:32 -0000	2.268
+++ intern.h	23 Sep 2004 05:02:15 -0000	2.269
@@ -572,7 +572,7 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 
-	void localizeArray(int slot, int script);
+	void localizeArray(int slot, byte script);
 	void redimArray(int arrayId, int newX, int newY, int d);
 	int readFileToArray(int slot, int32 size);
 	void writeFileFromArray(int slot, int resID);

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- script.cpp	19 Sep 2004 00:15:09 -0000	1.196
+++ script.cpp	23 Sep 2004 05:02:15 -0000	1.197
@@ -348,14 +348,14 @@
 }
 
 /* Nuke arrays based on script */
-void ScummEngine::nukeArrays(int script) {
+void ScummEngine::nukeArrays(byte script) {
 	int i;
 
-	if (_heversion < 60 || !script)
+	if (_heversion < 60 || script == 0)
 		return;
 
-	//FIXME Nukes wrong arrays in other
-	if (_gameId != GID_PUTTMOON)
+	//FIXME Nukes wrong arrays
+	if (_gameId == GID_FBEAR)
 		return;
 
 	for (i = 1; i < _numArray; i++) {

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.125
retrieving revision 2.126
diff -u -d -r2.125 -r2.126
--- script_v6he.cpp	22 Sep 2004 05:08:07 -0000	2.125
+++ script_v6he.cpp	23 Sep 2004 05:02:15 -0000	2.126
@@ -1154,7 +1154,7 @@
 	}
 }
 
-void ScummEngine_v60he::localizeArray(int slot, int script) {
+void ScummEngine_v60he::localizeArray(int slot, byte script) {
 	if (slot >= _numArray)
 		error("o60_localizeArray(%d): array slot out of range", slot);
 

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.226
retrieving revision 1.227
diff -u -d -r1.226 -r1.227
--- scumm.cpp	22 Sep 2004 03:56:26 -0000	1.226
+++ scumm.cpp	23 Sep 2004 05:02:15 -0000	1.227
@@ -1769,12 +1769,14 @@
 		stopCycle(0);
 	_sound->processSoundQues();
 
-	if (_heversion >= 70 && _wizPolygons) {		
+	if (_heversion >= 71 && _wizPolygons) {		
 		memset(_wizPolygons, 0, _wizNumPolygons * sizeof(WizPolygon));
 	}
 
+	// For HE80+ games
 	for (i = 0; i < _numRoomVariables; i++)
 		_roomVars[i] = 0;
+	nukeArrays(0xFFFFFFFF);
 
 	for (i = 1; i < _numActors; i++) {
 		_actors[i].hideActor();

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.494
retrieving revision 1.495
diff -u -d -r1.494 -r1.495
--- scumm.h	21 Sep 2004 21:10:23 -0000	1.494
+++ scumm.h	23 Sep 2004 05:02:15 -0000	1.495
@@ -592,7 +592,7 @@
 public:
 	void runScript(int script, bool freezeResistant, bool recursive, int *lvarptr);
 	void stopScript(int script);
-	void nukeArrays(int script);
+	void nukeArrays(byte script);
 
 protected:
 	void runObjectScript(int script, int entry, bool freezeResistant, bool recursive, int *vars, int slot = -1);





More information about the Scummvm-git-logs mailing list