From f01b8e9c45e3349c84346f270c17610b0e5350b0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2016 13:56:42 -0400 Subject: TITANIC: Fix multi-line text writing --- engines/titanic/support/font.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/titanic/support/font.h') diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h index 75c91f3d36..591fb4661c 100644 --- a/engines/titanic/support/font.h +++ b/engines/titanic/support/font.h @@ -31,7 +31,12 @@ namespace Titanic { -enum TextCommand { TEXTCMD_26 = 26, TEXTCMD_SET_COLOR = 27 }; +enum TextCommand { TEXTCMD_NPC = 26, TEXTCMD_SET_COLOR = 27 }; + +enum WriteCharacterResult { + WC_IN_BOUNDS = 0, WC_OUTSIDE_TOP = -1, WC_OUTSIDE_BOTTOM = -2, + WC_OUTSIDE_LEFT = -3, WC_OUTSIDE_RIGHT = -4 +}; class CVideoSurface; @@ -51,7 +56,7 @@ private: /** * Write a character */ - int writeChar(CVideoSurface *surface, unsigned char c, + WriteCharacterResult writeChar(CVideoSurface *surface, unsigned char c, const Common::Point &pt, const Rect &destRect, const Rect *srcRect); /** @@ -87,6 +92,8 @@ public: /** * Write a string to the specified surface + * @returns The index of the last character that was visible + * with the drawing area */ int writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect, int yOffset, const CString &str, CTextCursor *textCursor); -- cgit v1.2.3