aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-08 18:44:57 +0200
committerEinar Johan Trøan Sømåen2012-06-08 18:44:57 +0200
commitf7679dca8c3e0fc07d29376be49188e318273200 (patch)
tree2a83414fc4a520aafc0f421c95e6fc1b25d38902 /engines
parent1d5e59766fc1e6083921741a1ad270dd8d9363d1 (diff)
downloadscummvm-rg350-f7679dca8c3e0fc07d29376be49188e318273200.tar.gz
scummvm-rg350-f7679dca8c3e0fc07d29376be49188e318273200.tar.bz2
scummvm-rg350-f7679dca8c3e0fc07d29376be49188e318273200.zip
WINTERMUTE: Align TTF's properly.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/Base/BFontTT.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 68645e88bb..9b05790876 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -250,6 +250,15 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
Common::Array<Common::String> lines;
_font->wordWrapText(text, width, lines);
+ Graphics::TextAlign alignment = Graphics::kTextAlignInvalid;
+ if (align == TAL_LEFT) {
+ alignment = Graphics::kTextAlignLeft;
+ } else if (align == TAL_CENTER) {
+ alignment = Graphics::kTextAlignCenter;
+ } else if (align == TAL_RIGHT) {
+ alignment = Graphics::kTextAlignRight;
+ }
+
warning("CBFontTT::RenderTextToTexture - Not fully ported yet");
warning("%s %d %d %d %d", text.c_str(), D3DCOLGetR(_layers[0]->_color), D3DCOLGetG(_layers[0]->_color),D3DCOLGetB(_layers[0]->_color),D3DCOLGetA(_layers[0]->_color));
// void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
@@ -260,7 +269,7 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
Common::Array<Common::String>::iterator it;
int heightOffset = 0;
for (it = lines.begin(); it != lines.end(); it++) {
- _font->drawString(surface, *it, 0, heightOffset, width, useColor);
+ _font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment);
heightOffset += _lineHeight;
}