aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/text.cpp')
-rw-r--r--engines/kyra/text.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index edc46d3eb7..cfeca07c8d 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -551,12 +551,40 @@ void TextDisplayer::printTalkTextMessage(const char *text, int x, int y, uint8 c
_talkMessagePrinted = true;
}
-void TextDisplayer::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2) {
+void TextDisplayer::printIntroTextMessage(const char *text, int x, int y, uint8 col1, uint8 col2, uint8 col3, int dstPage, Screen::FontId font) {
+ debugC(9, kDebugLevelMain, "TextDisplayer::printIntroTextMessage('%s', %d, %d, %d, %d, %d, %d, %d)",
+ text, x, y, col1, col2, col3, dstPage, font);
+ 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;
+ int curPage = _screen->setCurPage(dstPage);
+
+ 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, col1, col2, col3, font);
+ }
+ _screen->_curPage = curPage;
+ _talkMessagePrinted = true;
+}
+
+void TextDisplayer::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) {
debugC(9, kDebugLevelMain, "TextDisplayer::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
uint8 colorMap[] = { 0, 15, 12, 12 };
colorMap[3] = c1;
_screen->setTextColor(colorMap, 0, 3);
- Screen::FontId curFont = _screen->setFont(Screen::FID_8_FNT);
+ Screen::FontId curFont = _screen->setFont(font);
_screen->_charWidth = -2;
_screen->printText(str, x, y, c0, c2);
_screen->_charWidth = 0;