From 5f12ad8de5d67128474da3e9cef5745edf3da45e Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 23 Sep 2005 12:35:30 +0000 Subject: Fix subtitle display in C64 maniac. svn-id: r18863 --- scumm/intern.h | 1 + scumm/script_c64.cpp | 36 ++++++++++++++++++++++++++++++++++++ scumm/string.cpp | 4 +++- 3 files changed, 40 insertions(+), 1 deletion(-) (limited to 'scumm') diff --git a/scumm/intern.h b/scumm/intern.h index 965933110c..12845ee1f0 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -406,6 +406,7 @@ protected: virtual const char *getOpcodeDesc(byte i); virtual void setupScummVars(); + virtual void decodeParseString(); virtual int getVarOrDirectWord(byte mask); virtual uint fetchScriptWord(); diff --git a/scumm/script_c64.cpp b/scumm/script_c64.cpp index 6c03abdd4f..e7c60208b4 100644 --- a/scumm/script_c64.cpp +++ b/scumm/script_c64.cpp @@ -389,6 +389,42 @@ int ScummEngine_c64::getObjectFlag() { return fetchScriptByte(); } +void ScummEngine_c64::decodeParseString() { + byte buffer[512]; + byte *ptr = buffer; + byte c; + bool insertSpace = false; + + while ((c = fetchScriptByte())) { + + insertSpace = (c & 0x80) != 0; + c &= 0x7f; + + if (c == '/') { + *ptr++ = 13; + } else { + *ptr++ = c; + } + + if (insertSpace) + *ptr++ = ' '; + + } + *ptr = 0; + + int textSlot = 0; + _string[textSlot].xpos = 0; + _string[textSlot].ypos = 0; + _string[textSlot].right = 320; + _string[textSlot].center = false; + _string[textSlot].overhead = false; + + if (_actorToPrintStrFor == 0xFF) + _string[textSlot].color = 14; + + actorTalk(buffer); +} + void ScummEngine_c64::setStateCommon(byte type) { int obj = getObjectFlag(); putState(obj, getState(obj) | type); diff --git a/scumm/string.cpp b/scumm/string.cpp index 49c45a378b..e949a04a55 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -236,7 +236,9 @@ void ScummEngine::CHARSET_1() { if (_charset->_center) { _charset->_nextLeft -= _charset->getStringWidth(0, buffer) / 2; } - if (!(_platform == Common::kPlatformFMTowns) && _string[0].height) { + if (_platform == Common::kPlatformC64 && _gameId == GID_MANIAC) { + break; + } else if (!(_platform == Common::kPlatformFMTowns) && _string[0].height) { _charset->_nextTop += _string[0].height; } else { _charset->_nextTop += _charset->getFontHeight(); -- cgit v1.2.3