diff options
Diffstat (limited to 'engines/dm/text.cpp')
-rw-r--r-- | engines/dm/text.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp index dcf7e27a8e..825c86a3b9 100644 --- a/engines/dm/text.cpp +++ b/engines/dm/text.cpp @@ -60,29 +60,29 @@ void TextMan::printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 de uint16 textLength = strlen(text); uint16 nextX = destX; uint16 nextY = destY; - byte *srcBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k557_FontGraphicIndice); + byte *srcBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxFont); byte *tmp = _vm->_displayMan->_tmpBitmap; - for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i) + for (uint16 i = 0; i < (kDMFontLetterWidth + 1) * kDMFontLetterHeight * 128; ++i) tmp[i] = srcBitmap[i] ? textColor : bgColor; srcBitmap = tmp; for (const char *begin = text, *end = text + textLength; begin != end; ++begin) { - if (nextX + k5_LetterWidth + 1 >= destPixelWidth || (*begin == '\n')) { + if (nextX + kDMFontLetterWidth + 1 >= destPixelWidth || (*begin == '\n')) { nextX = destX; - nextY += k6_LetterHeight + 1; + nextY += kDMFontLetterHeight + 1; } - if (nextY + k6_LetterHeight >= destHeight) + if (nextY + kDMFontLetterHeight >= destHeight) break; uint16 srcX = (1 + 5) * *begin; // 1 + 5 is not the letter width, arbitrary choice of the unpacking code - Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1); - _vm->_displayMan->blitToBitmap(srcBitmap, destBitmap, box, (nextX == destX) ? (srcX + 1) : srcX, 0, 6 * 128 / 2, destByteWidth, kM1_ColorNoTransparency, - k6_LetterHeight, destHeight); + Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + kDMFontLetterWidth + 1, nextY, nextY + kDMFontLetterHeight - 1); + _vm->_displayMan->blitToBitmap(srcBitmap, destBitmap, box, (nextX == destX) ? (srcX + 1) : srcX, 0, 6 * 128 / 2, destByteWidth, kDMColorNoTransparency, + kDMFontLetterHeight, destHeight); - nextX += k5_LetterWidth + 1; + nextX += kDMFontLetterWidth + 1; } } @@ -103,7 +103,7 @@ void TextMan::printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int } void TextMan::printLineFeed() { - printMessage(k0_ColorBlack, "\n"); + printMessage(kDMColorBlack, "\n"); } void TextMan::printMessage(Color color, const char *string, bool printWithScroll) { @@ -141,7 +141,7 @@ void TextMan::printMessage(Color color, const char *string, bool printWithScroll void TextMan::createNewRow() { if (_messageAreaCursorRow == 3) { isTextScrolling(&_textScroller, true); - memset(_bitmapMessageAreaNewRow, k0_ColorBlack, 320 * 7); + memset(_bitmapMessageAreaNewRow, kDMColorBlack, 320 * 7); _isScrolling = true; setScrollerCommand(&_textScroller, 1); @@ -156,9 +156,9 @@ void TextMan::createNewRow() { void TextMan::printString(Color color, const char* string) { int16 stringLength = strlen(string); if (isTextScrolling(&_textScroller, false)) - printToLogicalScreen(_messageAreaCursorColumn * 6, (_messageAreaCursorRow * 7 - 1) + 177, color, k0_ColorBlack, string); + printToLogicalScreen(_messageAreaCursorColumn * 6, (_messageAreaCursorRow * 7 - 1) + 177, color, kDMColorBlack, string); else { - printTextToBitmap(_bitmapMessageAreaNewRow, k160_byteWidthScreen, _messageAreaCursorColumn * 6, 0, color, k0_ColorBlack, string, 7); + printTextToBitmap(_bitmapMessageAreaNewRow, k160_byteWidthScreen, _messageAreaCursorColumn * 6, 0, color, kDMColorBlack, string, 7); _isScrolling = true; if (isTextScrolling(&_textScroller, false)) setScrollerCommand(&_textScroller, 1); @@ -192,15 +192,16 @@ void TextMan::moveCursor(int16 column, int16 row) { void TextMan::clearExpiredRows() { _vm->_displayMan->_useByteBoxCoordinates = false; Box displayBox; - displayBox._x1 = 0; - displayBox._x2 = 319; + displayBox._rect.left = 0; + displayBox._rect.right = 319; for (uint16 rowIndex = 0; rowIndex < 4; rowIndex++) { int32 expirationTime = _messageAreaRowExpirationTime[rowIndex]; if ((expirationTime == -1) || (expirationTime > _vm->_gameTime) || _isScrolling) continue; - displayBox._y2 = (displayBox._y1 = 172 + (rowIndex * 7)) + 6; + displayBox._rect.top = 172 + (rowIndex * 7); + displayBox._rect.bottom = displayBox._rect.top + 6; isTextScrolling(&_textScroller, true); - _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapScreen, displayBox, k0_ColorBlack, k160_byteWidthScreen, k200_heightScreen); + _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapScreen, displayBox, kDMColorBlack, k160_byteWidthScreen, k200_heightScreen); _messageAreaRowExpirationTime[rowIndex] = -1; } } @@ -217,14 +218,14 @@ void TextMan::printEndGameString(int16 x, int16 y, Color textColor, const char* wrkStringPtr++; *wrkStringPtr = *text++; } - printToLogicalScreen(x, y, textColor, k12_ColorDarkestGray, modifiedString); + printToLogicalScreen(x, y, textColor, kDMColorDarkestGray, modifiedString); } void TextMan::clearAllRows() { isTextScrolling(&_textScroller, true); Box tmpBox(0, 319, 169, 199); - _vm->_displayMan->fillScreenBox(tmpBox, k0_ColorBlack); + _vm->_displayMan->fillScreenBox(tmpBox, kDMColorBlack); _messageAreaCursorRow = 3; _messageAreaCursorColumn = 0; |