aboutsummaryrefslogtreecommitdiff
path: root/scumm/string.cpp
diff options
context:
space:
mode:
authorJames Brown2002-10-06 06:09:32 +0000
committerJames Brown2002-10-06 06:09:32 +0000
commit9612002d78bbf76a80f462ea1036e20739b2d9ca (patch)
tree0e95813c6499a06f3fd1c6e0c559fa90203b0bed /scumm/string.cpp
parent14831e74bf681de36e53b02ad7282a25727a7ff4 (diff)
downloadscummvm-rg350-9612002d78bbf76a80f462ea1036e20739b2d9ca.tar.gz
scummvm-rg350-9612002d78bbf76a80f462ea1036e20739b2d9ca.tar.bz2
scummvm-rg350-9612002d78bbf76a80f462ea1036e20739b2d9ca.zip
Full Throttle / The Dig fixes.
drawDescString (for Full Throttle object names, in the 'ring of fire') is still somewhat broken. Feel free to fix ;) svn-id: r5090
Diffstat (limited to 'scumm/string.cpp')
-rw-r--r--scumm/string.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 3d77a59131..5612a17a5b 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -504,6 +504,77 @@ void Scumm::description()
gdi._mask_bottom = charset._strBottom;
}
+void Scumm::drawDescString()
+{
+ byte byte1=0, chr, *buf, *charsetptr;
+ uint color, i;
+
+ buf = charset._buffer;
+ charset._bufPos = 0;
+
+ charset._left2 = charset._left = _string[0].xpos;
+ charset._top = _string[0].ypos;
+ charset._curId = _string[0].charset;
+ charset._center = _string[0].center;
+ charset._right = _string[0].right;
+ charset._color = _string[0].color;
+
+ charset._xpos2 = _string[0].xpos;
+ charset._ypos2 = _string[0].ypos;
+ charset._disableOffsX = charset._unk12 = 1;
+ _bkColor = 0;
+ _talkDelay = 1;
+
+ charset._left -= charset.getStringWidth(0, buf, 0) >> 1;
+
+ restoreCharsetBg();
+
+ // Read color mapping and height information
+ charsetptr = getResourceAddress(rtCharset, charset._curId);
+ assert(charsetptr);
+ charsetptr += 29;
+ for (i = 0; i < 4; i++)
+ charset._colorMap[i] = _charsetData[charset._curId][i];
+
+ byte1 = charsetptr[1]; // Character height
+
+ for (i = 0; (chr = buf[i++]) != 0;) {
+ if (chr == 254)
+ chr = 255;
+ if (chr == 255) {
+ chr = buf[i++];
+ switch (chr) {
+ case 9:
+ case 10:
+ case 13:
+ case 14:
+ i += 2;
+ break;
+ case 1:
+ case 8:
+ charset._left = charset._left2 - charset.getStringWidth(0, buf, i);
+ charset._top += byte1;
+ break;
+ case 12:
+ color = buf[i] + (buf[i + 1] << 8);
+ i += 2;
+ if (color == 0xFF)
+ charset._color = _string[0].color;
+ else
+ charset._color = color;
+ break;
+ }
+ } else {
+ charset.printChar(chr);
+ }
+ }
+
+ gdi._mask_left = charset._strLeft;
+ gdi._mask_right = charset._strRight;
+ gdi._mask_top = charset._strTop;
+ gdi._mask_bottom = charset._strBottom;
+}
+
void Scumm::drawString(int a)
{
byte buf[256];
@@ -560,6 +631,10 @@ void Scumm::drawString(int a)
charset._left -= charset.getStringWidth(a, buf, 0) >> 1;
}
+ if (!_features & GF_AFTER_V7)
+ charset._ignoreCharsetMask = 1;
+
+
// Verb text should never time out.
if (a == 4)
_talkDelay = -1;