aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-05-05 14:30:37 +0000
committerTravis Howell2005-05-05 14:30:37 +0000
commit30533838db4f518fe64726858760fb5c2b319950 (patch)
tree01e6dc71561c6ea4275d9846caddf5f7541a2e5a
parent4dacf09f72a647a654c047e7340edda01023eb78 (diff)
downloadscummvm-rg350-30533838db4f518fe64726858760fb5c2b319950.tar.gz
scummvm-rg350-30533838db4f518fe64726858760fb5c2b319950.tar.bz2
scummvm-rg350-30533838db4f518fe64726858760fb5c2b319950.zip
HE90+ games set heap size in index.
svn-id: r17920
-rw-r--r--scumm/resource_v7he.cpp4
-rw-r--r--scumm/scumm.cpp11
-rw-r--r--scumm/scumm.h1
3 files changed, 10 insertions, 6 deletions
diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp
index b0f0f38613..5ec64c8e02 100644
--- a/scumm/resource_v7he.cpp
+++ b/scumm/resource_v7he.cpp
@@ -1682,7 +1682,7 @@ void ScummEngine_v99he::readMAXS(int blockSize) {
_numImages = _fileHandle->readUint16LE();
_numSprites = _fileHandle->readUint16LE();
_numLocalScripts = _fileHandle->readUint16LE();
- _fileHandle->readUint16LE(); // heap related
+ _HEHeapSize = _fileHandle->readUint16LE(); // heap related
_numPalettes = _fileHandle->readUint16LE();
_numUnk = _fileHandle->readUint16LE();
_numTalkies = _fileHandle->readUint16LE();
@@ -1713,7 +1713,7 @@ void ScummEngine_v90he::readMAXS(int blockSize) {
_numImages = _fileHandle->readUint16LE();
_numSprites = _fileHandle->readUint16LE();
_numLocalScripts = _fileHandle->readUint16LE();
- _fileHandle->readUint16LE(); // heap releated
+ _HEHeapSize = _fileHandle->readUint16LE();
_numNewNames = 10;
_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 2c0e38084f..73565c4087 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -1418,12 +1418,15 @@ int ScummEngine::init(GameDetector &detector) {
else
res._maxHeapThreshold = gVars->memory[kMemScummOldCostGames];
#else
- // Since the new costumes are very big, we increase the heap limit, to avoid having
- // to constantly reload stuff from the data files.
- if (_features & GF_NEW_COSTUMES)
+ 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
+ } else {
res._maxHeapThreshold = 550000;
+ }
#endif
res._minHeapThreshold = 400000;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 7c8bce7c0e..38abf37b16 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -502,6 +502,7 @@ protected:
int _numNewNames, _numGlobalScripts;
int _numRoomVariables;
int _numPalettes, _numSprites, _numTalkies, _numUnk;
+ int _HEHeapSize;
public:
int _numLocalScripts, _numImages, _numRooms, _numScripts, _numSounds; // Used by HE games
int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette