The Dig: implement descriptions

svn-id: r4381
This commit is contained in:
Paweł Kołodziejski 2002-05-25 08:53:08 +00:00
parent 34c181cdcf
commit f7c69ad830
3 changed files with 64 additions and 4 deletions

View File

@ -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],

View File

@ -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);

View File

@ -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];