[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.540,1.541

kirben kirben at users.sourceforge.net
Thu Jun 2 07:42:34 CEST 2005


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

Modified Files:
	scumm.cpp 
Log Message:

HE games require min/max heap sizes to be set, after index is read.
Init _hePalettes, to fix valgrind warnings.


Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.540
retrieving revision 1.541
diff -u -d -r1.540 -r1.541
--- scumm.cpp	31 May 2005 23:57:59 -0000	1.540
+++ scumm.cpp	2 Jun 2005 14:40:13 -0000	1.541
@@ -946,6 +946,7 @@
 	_palManipPalette = NULL;
 	_palManipIntermediatePal = NULL;
 	memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
+	_hePalettes = NULL;
 	_shadowPalette = NULL;
 	_shadowPaletteSize = 0;
 	memset(_currentPalette, 0, sizeof(_currentPalette));
@@ -1513,24 +1514,6 @@
 		requestLoad(ConfMan.getInt("save_slot"));
 	}
 
-#ifdef __PALM_OS__
-	if (_features & GF_NEW_COSTUMES)
-		res._maxHeapThreshold = gVars->memory[kMemScummNewCostGames];
-	else
-		res._maxHeapThreshold = gVars->memory[kMemScummOldCostGames];
-#else
-	if (_heversion >= 90 && _HEHeapSize) {
-		res._maxHeapThreshold = _HEHeapSize * 1024;
-	} else if (_features & GF_NEW_COSTUMES) {
-		// Since the new costumes are very big, we increase the heap limit, to avoid having
-		// to constantly reload stuff from the data files.
-		res._maxHeapThreshold = 2500000;
-	} else {
-		res._maxHeapThreshold = 550000;
-	}
-#endif
-	res._minHeapThreshold = 400000;
-
 	allocResTypeData(rtBuffer, MKID('NONE'), 10, "buffer", 0);
 
 	setupScummVars();
@@ -1570,6 +1553,24 @@
 
 	readIndexFile();
 
+#ifdef __PALM_OS__
+	if (_features & GF_NEW_COSTUMES)
+		res._maxHeapThreshold = gVars->memory[kMemScummNewCostGames];
+	else
+		res._maxHeapThreshold = gVars->memory[kMemScummOldCostGames];
+#else
+	if (_heversion >= 90 && _HEHeapSize) {
+		res._maxHeapThreshold = _HEHeapSize * 1024;
+	} else if (_features & GF_NEW_COSTUMES) {
+		// Since the new costumes are very big, we increase the heap limit, to avoid having
+		// to constantly reload stuff from the data files.
+		res._maxHeapThreshold = 2500000;
+	} else {
+		res._maxHeapThreshold = 550000;
+	}
+#endif
+	res._minHeapThreshold = 400000;
+
 	scummInit();
 	initScummVars();
 
@@ -1885,6 +1886,7 @@
 	ScummEngine_v90he::scummInit();
 
 	_hePalettes = (uint8 *)malloc((_numPalettes + 1) * 1024);
+	memset(_hePalettes, 0, (_numPalettes + 1) * 1024);
 
 	// Array 129 is set to base name
 	int len = resStrLen((const byte *)_gameName.c_str()) + 1;





More information about the Scummvm-git-logs mailing list