diff options
author | Filippos Karapetis | 2012-01-15 20:58:14 +0200 |
---|---|---|
committer | Filippos Karapetis | 2012-01-15 20:58:14 +0200 |
commit | 96aa86a60b036041446ff52975472ae23887a85f (patch) | |
tree | 61c4d80a35028613a3b9adbc57fcb907b10f9d09 | |
parent | 34b297748c8e67995d84453b2b36b388161b93dc (diff) | |
download | scummvm-rg350-96aa86a60b036041446ff52975472ae23887a85f.tar.gz scummvm-rg350-96aa86a60b036041446ff52975472ae23887a85f.tar.bz2 scummvm-rg350-96aa86a60b036041446ff52975472ae23887a85f.zip |
SCI: Remove wrong script-to-array copying code in kArray
-rw-r--r-- | engines/sci/engine/klists.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 83e59c9c20..2a33df26bc 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -753,7 +753,6 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) { reg_t arrayHandle = argv[1]; SciArray<reg_t> *array1 = s->_segMan->lookupArray(argv[1]); - //SciArray<reg_t> *array1 = !argv[1].isNull() ? s->_segMan->lookupArray(argv[1]) : s->_segMan->allocateArray(&arrayHandle); SciArray<reg_t> *array2 = s->_segMan->lookupArray(argv[3]); uint32 index1 = argv[2].toUint16(); uint32 index2 = argv[4].toUint16(); @@ -790,21 +789,8 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) { #endif return NULL_REG; } - SegmentType sourceType = s->_segMan->getSegmentObj(argv[1].segment)->getType(); - if (sourceType == SEG_TYPE_SCRIPT) { - // A technique used in later SCI2.1 and SCI3 games: the contents of a script - // are loaded in an array (well, actually a string). - Script *scr = s->_segMan->getScript(argv[1].segment); - reg_t stringHandle; - - SciString *dupString = s->_segMan->allocateString(&stringHandle); - dupString->setSize(scr->getBufSize()); - dupString->fromString(Common::String((const char *)scr->getBuf())); - - return stringHandle; - } else if (sourceType != SEG_TYPE_ARRAY && sourceType != SEG_TYPE_SCRIPT) { - error("kArray(Dup): Request to duplicate a segment which isn't an array or a script"); - } + if (s->_segMan->getSegmentObj(argv[1].segment)->getType() != SEG_TYPE_ARRAY) + error("kArray(Dup): Request to duplicate a segment which isn't an array"); reg_t arrayHandle; SciArray<reg_t> *dupArray = s->_segMan->allocateArray(&arrayHandle); |