aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-06-02 14:40:13 +0000
committerTravis Howell2005-06-02 14:40:13 +0000
commit0e26360fe31dc467955292b097889cf7f1b7eb7a (patch)
treecb26a251c5a59808bba65010ba0ed1cf4dbf7b1f
parentbf89c8a4b9eb485e9248d5da3aac1d16c1310d7f (diff)
downloadscummvm-rg350-0e26360fe31dc467955292b097889cf7f1b7eb7a.tar.gz
scummvm-rg350-0e26360fe31dc467955292b097889cf7f1b7eb7a.tar.bz2
scummvm-rg350-0e26360fe31dc467955292b097889cf7f1b7eb7a.zip
HE games require min/max heap sizes to be set, after index is read.
Init _hePalettes, to fix valgrind warnings. svn-id: r18311
-rw-r--r--scumm/scumm.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 8e36c2193d..62c732eba7 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -946,6 +946,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_palManipPalette = NULL;
_palManipIntermediatePal = NULL;
memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
+ _hePalettes = NULL;
_shadowPalette = NULL;
_shadowPaletteSize = 0;
memset(_currentPalette, 0, sizeof(_currentPalette));
@@ -1513,24 +1514,6 @@ int ScummEngine::init(GameDetector &detector) {
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 @@ int ScummEngine::init(GameDetector &detector) {
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 @@ void ScummEngine_v99he::scummInit() {
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;