diff options
author | Eugene Sandulenko | 2016-10-06 23:48:50 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-06 23:49:39 +0200 |
commit | b2dcd1bb1ef920e7723501c9500a8ef0348be03a (patch) | |
tree | da8a53526126c8edc7195bcbbb7317cbc6ff0e81 /engines/director/frame.cpp | |
parent | 59a7993951d80d2db651e773f3bb16b12e3f6f56 (diff) | |
download | scummvm-rg350-b2dcd1bb1ef920e7723501c9500a8ef0348be03a.tar.gz scummvm-rg350-b2dcd1bb1ef920e7723501c9500a8ef0348be03a.tar.bz2 scummvm-rg350-b2dcd1bb1ef920e7723501c9500a8ef0348be03a.zip |
GRAPHICS: Move font-related MacGUI code to MacFontManager
Diffstat (limited to 'engines/director/frame.cpp')
-rw-r--r-- | engines/director/frame.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index d6f63a8584..2eaddc50f2 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -22,6 +22,7 @@ #include "common/system.h" #include "graphics/font.h" +#include "graphics/macgui/macfontmanager.h" #include "graphics/macgui/macwindowmanager.h" #include "image/bmp.h" @@ -606,16 +607,14 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) { int height = _sprites[spriteID]->_height; int width = _sprites[spriteID]->_width; - const char *fontName; + Graphics::MacFont macFont(textCast->fontId, textCast->fontSize); if (_vm->_currentScore->_fontMap.contains(textCast->fontId)) { - fontName = _vm->_currentScore->_fontMap[textCast->fontId].c_str(); - } else if ((fontName = _vm->_wm->getFontName(textCast->fontId, textCast->fontSize)) == NULL) { - warning("Unknown font id %d, falling back to default", textCast->fontId); - fontName = _vm->_wm->getFontName(0, 12); + // Override + macFont.setName(_vm->_currentScore->_fontMap[textCast->fontId]); } - const Graphics::Font *font = _vm->_wm->getFont(fontName, Graphics::FontManager::kBigGUIFont); + const Graphics::Font *font = _vm->_wm->_fontMan->getFont(macFont); font->drawString(&surface, text, x, y, width, 0); |