aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2016-09-04 16:30:47 -0500
committerColin Snover2016-09-29 19:39:16 -0500
commit3f9172676526aa04983f148d1262af6ea9fb53ef (patch)
treee2729dc6ac8a5142147001dfdcc5856919706340 /engines/sci/graphics
parent240b0ca3488231e0cfb9c56b1c21ccdd309f0908 (diff)
downloadscummvm-rg350-3f9172676526aa04983f148d1262af6ea9fb53ef.tar.gz
scummvm-rg350-3f9172676526aa04983f148d1262af6ea9fb53ef.tar.bz2
scummvm-rg350-3f9172676526aa04983f148d1262af6ea9fb53ef.zip
SCI32: Rewrite kArray & kString
This change invalidates earlier SCI32 save games, which separated arrays and strings in an incompatible manner. Old save games contain invalid references to a string segment which no longer exists, and contain incompatible array structures that lack critical type information.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/controls32.cpp4
-rw-r--r--engines/sci/graphics/transitions32.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index bdc7248708..89997d38a5 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -313,8 +313,8 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
if (textChanged) {
editor.text.trim();
- SciString *string = _segMan->lookupString(textObject);
- string->fromString(editor.text);
+ SciArray &string = *_segMan->lookupArray(textObject);
+ string.fromString(editor.text);
}
return make_reg(0, textChanged);
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index e98f783922..c45017efd4 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -267,9 +267,9 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
// NOTE: SCI2.1mid engine does no check to verify that an array is
// successfully retrieved, and SegMan will cause a fatal error
// if we try to use a memory segment that is not an array
- SciArray<reg_t> *table = _segMan->lookupArray(pFadeArray);
+ SciArray &table = *_segMan->lookupArray(pFadeArray);
- uint32 rangeCount = table->getSize();
+ uint32 rangeCount = table.size();
entry->fadeColorRangesCount = rangeCount;
// NOTE: SCI engine code always allocates memory even if the range
@@ -278,7 +278,7 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb
if (rangeCount > 0) {
entry->fadeColorRanges = new uint16[rangeCount];
for (size_t i = 0; i < rangeCount; ++i) {
- entry->fadeColorRanges[i] = table->getValue(i).toUint16();
+ entry->fadeColorRanges[i] = table.int16At(i);
}
}
}