aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/screen_manager.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-24 17:16:32 -0400
committerPaul Gilbert2016-07-10 16:12:00 -0400
commitc75de59a28c94e364a38af39057af720ba8465d4 (patch)
tree0fbd1ac099d39b31f2791193c26f172bfc23b178 /engines/titanic/support/screen_manager.h
parenta88c0b09994562d4576e7dd08db8ad2fe3326f53 (diff)
downloadscummvm-rg350-c75de59a28c94e364a38af39057af720ba8465d4.tar.gz
scummvm-rg350-c75de59a28c94e364a38af39057af720ba8465d4.tar.bz2
scummvm-rg350-c75de59a28c94e364a38af39057af720ba8465d4.zip
TITANIC: Implementing font text bounds calculations
Diffstat (limited to 'engines/titanic/support/screen_manager.h')
-rw-r--r--engines/titanic/support/screen_manager.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index d0580d4957..baba662564 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -110,14 +110,25 @@ public:
virtual void proc14() = 0;
virtual void proc15() = 0;
+ /**
+ * Get the text area a string will fit into
+ * @param str String
+ * @param maxWidth Maximum width in pixels
+ * @param sizeOut Optional pointer to output size
+ * @returns Required height
+ */
+ virtual int getTextBounds(const CString &str, int maxWidth, Point *sizeOut = nullptr) const = 0;
+
+ /**
+ * Get the current font height
+ */
+ virtual int getFontHeight() const = 0;
/**
- * Write out a string
+ * Returns the width of a given string in pixels
*/
- virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2) = 0;
+ virtual int stringWidth(const CString &str) = 0;
- virtual void getFont() = 0;
- virtual void proc18() = 0;
virtual void proc19() = 0;
/**
@@ -216,12 +227,24 @@ public:
virtual void proc15();
/**
- * Write out a string
+ * Get the text area a string will fit into
+ * @param str String
+ * @param maxWidth Maximum width in pixels
+ * @param sizeOut Optional pointer to output size
+ * @returns Required height
+ */
+ virtual int getTextBounds(const CString &str, int maxWidth, Point *sizeOut = nullptr) const;
+
+ /**
+ * Get the current font height
+ */
+ virtual int getFontHeight() const;
+
+ /**
+ * Returns the width of a given string in pixels
*/
- virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+ virtual int stringWidth(const CString &str);
- virtual void getFont();
- virtual void proc18();
virtual void proc19();
/**