[Scummvm-cvs-logs] SF.net SVN: scummvm:[51722] scummvm/trunk/engines/sci/graphics/frameout.cpp
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Wed Aug 4 07:06:41 CEST 2010
Revision: 51722
http://scummvm.svn.sourceforge.net/scummvm/?rev=51722&view=rev
Author: mthreepwood
Date: 2010-08-04 05:06:41 +0000 (Wed, 04 Aug 2010)
Log Message:
-----------
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!
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/frameout.cpp
Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-08-04 04:23:00 UTC (rev 51721)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-08-04 05:06:41 UTC (rev 51722)
@@ -485,7 +485,15 @@
// 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));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list