diff options
author | Filippos Karapetis | 2010-06-01 14:41:48 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-01 14:41:48 +0000 |
commit | e083c20da1aab0090a5fc3ea624c9810c63dad52 (patch) | |
tree | 8afe1c12bdba317e799049cdd49dec49281e728f /engines/sci/engine/kernel32.cpp | |
parent | 400542a1fe688bb702a89333c833bc1d89dd1ed4 (diff) | |
download | scummvm-rg350-e083c20da1aab0090a5fc3ea624c9810c63dad52.tar.gz scummvm-rg350-e083c20da1aab0090a5fc3ea624c9810c63dad52.tar.bz2 scummvm-rg350-e083c20da1aab0090a5fc3ea624c9810c63dad52.zip |
The system strings segment is a fixed segment of the segment manager, which doesn't change during the game, thus move all the system strings code and variables inside the segment manager
svn-id: r49372
Diffstat (limited to 'engines/sci/engine/kernel32.cpp')
-rw-r--r-- | engines/sci/engine/kernel32.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp index b705bbb794..3dd596494d 100644 --- a/engines/sci/engine/kernel32.cpp +++ b/engines/sci/engine/kernel32.cpp @@ -575,16 +575,16 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { uint32 count = argv[5].toSint16() == -1 ? string2.size() - index2 + 1 : argv[5].toUint16(); // We have a special case here for argv[1] being a system string - if (argv[1].segment == s->sys_strings_segment) { + if (argv[1].segment == s->_segMan->getSysStringsSegment()) { // Resize if necessary - if ((uint32)s->sys_strings->_strings[argv[1].toUint16()]._maxSize < index1 + count) { - delete[] s->sys_strings->_strings[argv[1].toUint16()]._value; - s->sys_strings->_strings[argv[1].toUint16()]._maxSize = index1 + count; - s->sys_strings->_strings[argv[1].toUint16()]._value = new char[index1 + count]; - memset(s->sys_strings->_strings[argv[1].toUint16()]._value, 0, index1 + count); + if ((uint32)s->_segMan->sysStrings->_strings[argv[1].toUint16()]._maxSize < index1 + count) { + delete[] s->_segMan->sysStrings->_strings[argv[1].toUint16()]._value; + s->_segMan->sysStrings->_strings[argv[1].toUint16()]._maxSize = index1 + count; + s->_segMan->sysStrings->_strings[argv[1].toUint16()]._value = new char[index1 + count]; + memset(s->_segMan->sysStrings->_strings[argv[1].toUint16()]._value, 0, index1 + count); } - strncpy(s->sys_strings->_strings[argv[1].toUint16()]._value + index1, string2.c_str() + index2, count); + strncpy(s->_segMan->sysStrings->_strings[argv[1].toUint16()]._value + index1, string2.c_str() + index2, count); } else { SciString *string1 = s->_segMan->lookupString(argv[1]); |