aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/frameout.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-08-04 05:06:41 +0000
committerMatthew Hoops2010-08-04 05:06:41 +0000
commitcbe07a07b7bad5dec7630d85675128cd5f7ece51 (patch)
tree175284b020694d67930212e722904bf793fb9243 /engines/sci/graphics/frameout.cpp
parentbde4012f464a47ebe43a5f0498c7a18c40889140 (diff)
downloadscummvm-rg350-cbe07a07b7bad5dec7630d85675128cd5f7ece51.tar.gz
scummvm-rg350-cbe07a07b7bad5dec7630d85675128cd5f7ece51.tar.bz2
scummvm-rg350-cbe07a07b7bad5dec7630d85675128cd5f7ece51.zip
SCI: Fix SCI32 texts that are in Str objects
The text selector of the text bitmap object can contain either a Str object or a raw string. Handling the Str object case fixes the Torin demo. Oooh! Vertical scrolling! svn-id: r51722
Diffstat (limited to 'engines/sci/graphics/frameout.cpp')
-rw-r--r--engines/sci/graphics/frameout.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index fd559917ca..9816e0caa6 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -485,7 +485,15 @@ void GfxFrameout::kernelFrameout() {
// This draws text the "SCI0-SCI11" way. In SCI2, text is prerendered in kCreateTextBitmap
// TODO: rewrite this the "SCI2" way (i.e. implement the text buffer to draw inside kCreateTextBitmap)
if (lookupSelector(_segMan, itemEntry->object, SELECTOR(text), NULL, NULL) == kSelectorVariable) {
- Common::String text = _segMan->getString(readSelector(_segMan, itemEntry->object, SELECTOR(text)));
+ reg_t stringObject = readSelector(_segMan, itemEntry->object, SELECTOR(text));
+
+ // The object in the text selector of the item can be either a raw string
+ // or a Str object. In the latter case, we need to access the object's data
+ // selector to get the raw string.
+ if (_segMan->isHeapObject(stringObject))
+ stringObject = readSelector(_segMan, stringObject, SELECTOR(data));
+
+ Common::String text = _segMan->getString(stringObject);
GfxFont *font = _cache->getFont(readSelectorValue(_segMan, itemEntry->object, SELECTOR(font)));
bool dimmed = readSelectorValue(_segMan, itemEntry->object, SELECTOR(dimmed));
uint16 foreColor = readSelectorValue(_segMan, itemEntry->object, SELECTOR(fore));