aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/resources/fontresource.cpp
diff options
context:
space:
mode:
authorEric Fry2018-04-27 21:56:56 +1000
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit43ba5f6327c21e60c9c73b2f2f93e71dbde7bf08 (patch)
treedff47d532fc513df5086d9a4b27d87d4c55b7c77 /engines/illusions/resources/fontresource.cpp
parenta36cd2e39fce85e5cc1024322767284ba9b8e3b4 (diff)
downloadscummvm-rg350-43ba5f6327c21e60c9c73b2f2f93e71dbde7bf08.tar.gz
scummvm-rg350-43ba5f6327c21e60c9c73b2f2f93e71dbde7bf08.tar.bz2
scummvm-rg350-43ba5f6327c21e60c9c73b2f2f93e71dbde7bf08.zip
ILLUSIONS: Fill in background for text in menus
Diffstat (limited to 'engines/illusions/resources/fontresource.cpp')
-rw-r--r--engines/illusions/resources/fontresource.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/illusions/resources/fontresource.cpp b/engines/illusions/resources/fontresource.cpp
index 29aaf9bf65..4c89708fbc 100644
--- a/engines/illusions/resources/fontresource.cpp
+++ b/engines/illusions/resources/fontresource.cpp
@@ -110,6 +110,15 @@ CharInfo *FontResource::getCharInfo(uint16 c) {
return 0;
}
+const Common::Rect FontResource::calculateRectForText(uint16 *text, uint textLength) {
+ int16 width = 0;
+ for (uint i = 0; i < textLength && *text; i++) {
+ width += getCharInfo(*text)->_width;
+ text++;
+ }
+ return Common::Rect(width, getCharHeight() + getLineIncr());
+}
+
// FontInstance
FontInstance::FontInstance(IllusionsEngine *vm) : _vm(vm) {