void TextDisplayer::printTalkTextMessage(const char *text, int x, int y, uint8 color, int srcPage, int dstPage) { char *str = preprocessString(text); int lineCount = buildMessageSubstrings(str); int top = y - lineCount * 10; if (top < 0) { top = 0; } _talkMessageY = top; _talkMessageH = lineCount * 10; int w = getWidestLineWidth(lineCount); int x1, x2; calcWidestLineBounds(x1, x2, w, x); _talkCoords.x = x1; _talkCoords.w = w + 2; _screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkCoords.y, _talkCoords.w, _talkMessageH, srcPage, dstPage, Screen::CR_NO_P_CHECK); int curPage = _screen->_curPage; _screen->_curPage = srcPage; if (_vm->gameFlags().platform == Common::kPlatformAmiga) setTextColor(color); for (int i = 0; i < lineCount; ++i) { top = i * 10 + _talkMessageY; char *msg = &_talkSubstrings[i * TALK_SUBSTRING_LEN]; int left = getCenterStringX(msg, x1, x2); printText(msg, left, top, color, 0xC, 0); } _screen->_curPage = curPage; _talkMessagePrinted = true; }
void TextDisplayer::printCharacterText(const char *text, int8 charNum, int charX) { int top, left, x1, x2, w, x; char *msg; text = preprocessString(text); int lineCount = buildMessageSubstrings(text); w = getWidestLineWidth(lineCount); x = charX; calcWidestLineBounds(x1, x2, w, x); uint8 color = 0; if (_vm->gameFlags().platform == Common::kPlatformAmiga) { const uint8 colorTable[] = { 0x1F, 0x1B, 0xC9, 0x80, 0x1E, 0x81, 0x11, 0xD8, 0x55, 0x3A, 0x3A }; color = colorTable[charNum]; setTextColor(color); } else { const uint8 colorTable[] = { 0x0F, 0x09, 0xC9, 0x80, 0x05, 0x81, 0x0E, 0xD8, 0x55, 0x3A, 0x3A }; color = colorTable[charNum]; } for (int i = 0; i < lineCount; ++i) { top = i * 10 + _talkMessageY; msg = &_talkSubstrings[i * TALK_SUBSTRING_LEN]; left = getCenterStringX(msg, x1, x2); printText(msg, left, top, color, 0xC, 0); } }
void TextDisplayer_LoL::printDialogueText(int dim, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex) { int oldDim = 0; const bool isPc98 = (_vm->gameFlags().platform == Common::kPlatformPC98); if (dim == 3) { if (_vm->_updateFlags & 2) { oldDim = clearDim(4); _textDimData[4].color1 = isPc98 ? 0x33 : 254; _textDimData[4].color2 = _screen->_curDim->unkA; } else { oldDim = clearDim(3); _textDimData[3].color1 = isPc98 ? 0x33 : 192; _textDimData[3].color2 = _screen->_curDim->unkA; if (!isPc98) _screen->copyColor(192, 254); _vm->enableTimer(11); _vm->_textColorFlag = 0; _vm->_fadeText = false; } } else { oldDim = _screen->curDimIndex(); _screen->setScreenDim(dim); _lineCount = 0; _textDimData[dim].color1 = isPc98 ? 0x33 : 254; _textDimData[dim].color2 = _screen->_curDim->unkA; } int cp = _screen->setCurPage(0); Screen::FontId of = _screen->setFont(_vm->gameFlags().use16ColorMode ? Screen::FID_SJIS_FNT : Screen::FID_9_FNT); preprocessString(str, script, paramList, paramIndex); _numCharsTotal = strlen(_dialogueBuffer); displayText(_dialogueBuffer); _screen->setScreenDim(oldDim); _lineCount = 0; _screen->setCurPage(cp); _screen->setFont(of); _vm->_fadeText = false; }