aboutsummaryrefslogtreecommitdiff
path: root/engines/director/frame.cpp
diff options
context:
space:
mode:
authorTobia Tesan2017-05-01 12:29:36 +0200
committerEugene Sandulenko2017-05-02 21:01:23 +0100
commitca89722d5795aed26b398107b9330f1beb4388cd (patch)
tree6ccbf72e8678a392f1d68628f05f96d5b378999e /engines/director/frame.cpp
parentbd7ded3f56c61b4a9eb0798b34dcce17140af334 (diff)
downloadscummvm-rg350-ca89722d5795aed26b398107b9330f1beb4388cd.tar.gz
scummvm-rg350-ca89722d5795aed26b398107b9330f1beb4388cd.tar.bz2
scummvm-rg350-ca89722d5795aed26b398107b9330f1beb4388cd.zip
DIRECTOR: Use CachedMacText for rendering
Diffstat (limited to 'engines/director/frame.cpp')
-rw-r--r--engines/director/frame.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index af99248c04..cdf5283ab7 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -29,6 +29,7 @@
#include "image/bmp.h"
#include "director/director.h"
+#include "director/cachedmactext.h"
#include "director/cast.h"
#include "director/frame.h"
#include "director/images.h"
@@ -770,21 +771,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
//uint32 rectLeft = textCast->initialRect.left;
//uint32 rectTop = textCast->initialRect.top;
-
- int alignment = (int)textCast->textAlign;
- if (alignment == -1)
- alignment = 3;
- else
- alignment++;
-
- Graphics::MacText mt(textCast->_ftext, _vm->_wm, macFont, 0x00, 0xff, width, (Graphics::TextAlign)alignment, 1);
- mt.render();
- const Graphics::ManagedSurface *textSurface = mt.getSurface();
+ textCast->cachedMacText->clip(width);
+ textCast->cachedMacText->setWm(_vm->_wm); // TODO this is not a good place to do it
+ const Graphics::ManagedSurface *textSurface = textCast->cachedMacText->getSurface();
height = textSurface->h;
if (textSize != NULL) {
// TODO: this offset could be due to incorrect fonts loaded!
- textSize->bottom = height + mt.getLineCount();
+ textSize->bottom = height + textCast->cachedMacText->getLineCount();
}
uint16 textX = 0, textY = 0;