diff options
author | Max Horn | 2004-01-19 20:27:31 +0000 |
---|---|---|
committer | Max Horn | 2004-01-19 20:27:31 +0000 |
commit | 923adce4562897a6df4f023622f1770d0eac4c15 (patch) | |
tree | 8da9ef77ee87ffa0b98c5d85cf496ae697e51673 /scumm/script.cpp | |
parent | 8e89f7d060ca5fac1efc7c244df91b678f7e2c9d (diff) | |
download | scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.tar.gz scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.tar.bz2 scummvm-rg350-923adce4562897a6df4f023622f1770d0eac4c15.zip |
fix endian bug when dealing with ArrayHeader's; added a hack to permit save games broken due to this to still work; moved the whole 'Array' stuff into ScummEngine_v6
svn-id: r12521
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r-- | scumm/script.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index 36cd30f77f..5c329c31ba 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -980,76 +980,6 @@ bool ScummEngine::isRoomScriptRunning(int script) const { return false; } -int ScummEngine::defineArray(int array, int type, int dim2, int dim1) { - int id; - int size; - ArrayHeader *ah; - - if (type != 4) - type = 5; - - nukeArray(array); - - id = getArrayId(); - - if (_version == 8) { - if (array & 0x40000000) { - } - - if (array & 0x80000000) { - error("Can't define bit variable as array pointer"); - } - - size = (type == 5) ? 32 : 8; - } else { - if (array & 0x4000) { - } - - if (array & 0x8000) { - error("Can't define bit variable as array pointer"); - } - - size = (type == 5) ? 16 : 8; - } - - writeVar(array, id); - - size *= dim2 + 1; - size *= dim1 + 1; - size >>= 3; - - ah = (ArrayHeader *)createResource(rtString, id, size + sizeof(ArrayHeader)); - - ah->type = type; - ah->dim1_size = dim1 + 1; - ah->dim2_size = dim2 + 1; - - return id; -} - -void ScummEngine::nukeArray(int a) { - int data; - - data = readVar(a); - - if (data) - nukeResource(rtString, data); - - writeVar(a, 0); -} - -int ScummEngine::getArrayId() { - byte **addr = _baseArrays; - int i; - - for (i = 1; i < _numArray; i++) { - if (!addr[i]) - return i; - } - error("Out of array pointers, %d max", _numArray); - return -1; -} - void ScummEngine::copyScriptString(byte *dst) { int len = resStrLen(_scriptPointer) + 1; while (len--) |