diff options
author | Paweł Kołodziejski | 2002-05-25 08:53:08 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2002-05-25 08:53:08 +0000 |
commit | f7c69ad830b74986a8579404e36cf1fd3df19fe5 (patch) | |
tree | 4ca18906c63f022057fb99af25eee550067ad964 | |
parent | 34c181cdcf1b91952031b2de98128b66fd3eb3b8 (diff) | |
download | scummvm-rg350-f7c69ad830b74986a8579404e36cf1fd3df19fe5.tar.gz scummvm-rg350-f7c69ad830b74986a8579404e36cf1fd3df19fe5.tar.bz2 scummvm-rg350-f7c69ad830b74986a8579404e36cf1fd3df19fe5.zip |
The Dig: implement descriptions
svn-id: r4381
-rw-r--r-- | script_v2.cpp | 16 | ||||
-rw-r--r-- | scumm.h | 1 | ||||
-rw-r--r-- | string.cpp | 51 |
3 files changed, 64 insertions, 4 deletions
diff --git a/script_v2.cpp b/script_v2.cpp index fa99f8330d..86c85b55db 100644 --- a/script_v2.cpp +++ b/script_v2.cpp @@ -2728,10 +2728,18 @@ void Scumm::o6_miscOps() _insaneFlag = args[1]; break; case 16: - byte buf[200]; - _msgPtrToAdd = buf; - addMessageToStack(getStringAddressVar(VAR_STRING2DRAW)); - + if (_gameId == GID_DIG) { + _msgPtrToAdd = charset._buffer; + _messagePtr = addMessageToStack(getStringAddressVar(VAR_STRING2DRAW)); + i = 0; + while (charset._buffer[i] != 0) { + if (charset._buffer[i] == '/') { + charset._bufPos = i + 1; + } + i++; + } + description(); + } break; case 17: warning("o6_miscOps: stub17(%d,%d,%d,%d)", args[1], args[2], args[3], @@ -1210,6 +1210,7 @@ public: void restoreCharsetBg(); int hasCharsetMask(int x, int y, int x2, int y2); void CHARSET_1(); + void description(); byte *_msgPtrToAdd; byte *addMessageToStack(byte *msg); void unkAddMsgToStack2(int var); diff --git a/string.cpp b/string.cpp index 68e55f9115..192c034aab 100644 --- a/string.cpp +++ b/string.cpp @@ -440,6 +440,57 @@ void Scumm::CHARSET_1() gdi._mask_bottom = charset._strBottom; } +void Scumm::description() +{ + int c; + byte *buffer; + + buffer = charset._buffer + charset._bufPos; + string[0].ypos = camera._cur.y + 88; + string[0].xpos = 160 - (charset.getStringWidth(0, buffer, 0) >> 1); + if (string[0].xpos < 0) + string[0].xpos = 0; + + charset._top = string[0].ypos; + charset._left = string[0].xpos; + charset._left2 = string[0].xpos; + charset._right = 319; + charset._xpos2 = string[0].xpos; + charset._ypos2 = string[0].ypos; + charset._disableOffsX = charset._unk12 = 1; + charset._curId = 3; + charset._center = false; + charset._color = 15; + _bkColor = 0; + _talkDelay = 1; + + restoreCharsetBg(); + + _lastXstart = virtscr[0].xstart; + + do { + c = *buffer++; + if (c == 0) { + _haveMsg = 1; + break; + } + if (c != 0xFF) { + charset._left = charset._xpos2; + charset._top = charset._ypos2; + charset.printChar(c); + charset._xpos2 = charset._left; + charset._ypos2 = charset._top; + continue; + } + + } while (1); + + 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]; |