diff options
author | Paul Gilbert | 2016-04-27 19:50:48 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:12:07 -0400 |
commit | a2f933a80e5e830cdbcbb530f334c41725ee87b2 (patch) | |
tree | ec23dffabdf9dcc01914cdd42016a07c0ab9d279 | |
parent | d6b104d5a3e4ad7baebee8504ed60537a35a429e (diff) | |
download | scummvm-rg350-a2f933a80e5e830cdbcbb530f334c41725ee87b2.tar.gz scummvm-rg350-a2f933a80e5e830cdbcbb530f334c41725ee87b2.tar.bz2 scummvm-rg350-a2f933a80e5e830cdbcbb530f334c41725ee87b2.zip |
TITANIC: Minor fleshing out on font drawing
-rw-r--r-- | engines/titanic/support/font.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/support/font.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp index c6fd871e78..d1c947f01e 100644 --- a/engines/titanic/support/font.cpp +++ b/engines/titanic/support/font.cpp @@ -128,11 +128,11 @@ int STFont::stringWidth(const CString &text) const { } int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect, - int val1, const CString &str, CTextCursor *textCursor) { + int yOffset, const CString &str, CTextCursor *textCursor) { if (!_fontHeight || !_dataPtr) return -1; - Point textSize; + Point textSize(0, -yOffset); Rect destBounds = destRect; destBounds.constrain(rect1); if (destBounds.isEmpty()) @@ -171,7 +171,7 @@ int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &d } } - if (textCursor && textCursor->get54() == -2) { + if (textCursor && textCursor->getMode() == -2) { Point cursorPos(rect1.left + textSize.x, rect1.top + textSize.y); textCursor->setPos(cursorPos); } @@ -236,7 +236,8 @@ void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) { uint16 *destP = lineP; for (int xp = rect.left; xp < rect.right; ++xp, ++destP) { const byte *srcP = _dataPtr + yp * _dataWidth + xp; - //surface->changePixel(destP, color, *srcP >> 3, 1); + if (*srcP >> 3) + *destP = color; } } diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h index f2d7c471d9..75c91f3d36 100644 --- a/engines/titanic/support/font.h +++ b/engines/titanic/support/font.h @@ -89,7 +89,7 @@ public: * Write a string to the specified surface */ int writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect, - int val1, const CString &str, CTextCursor *textCursor); + int yOffset, const CString &str, CTextCursor *textCursor); /** * Get the text area a string will fit into |