diff options
author | Torbjörn Andersson | 2005-05-16 12:26:44 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-05-16 12:26:44 +0000 |
commit | 8eee14934b7bcba1a6de1a0f5228e9c7adc9ca1b (patch) | |
tree | 5b6de6e9a5818da7b2d92beba296638bbba3e158 /scumm/dialogs.cpp | |
parent | 469319aa7009486e3f15475fed115708ffdc9a0d (diff) | |
download | scummvm-rg350-8eee14934b7bcba1a6de1a0f5228e9c7adc9ca1b.tar.gz scummvm-rg350-8eee14934b7bcba1a6de1a0f5228e9c7adc9ca1b.tar.bz2 scummvm-rg350-8eee14934b7bcba1a6de1a0f5228e9c7adc9ca1b.zip |
Made InfoDialog scale itself.
svn-id: r18128
Diffstat (limited to 'scumm/dialogs.cpp')
-rw-r--r-- | scumm/dialogs.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 4daf9fe991..3bcc014403 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -727,12 +727,28 @@ InfoDialog::InfoDialog(ScummEngine *scumm, const String& message) } void InfoDialog::setInfoText(const String& message) { - int width = g_gui.getStringWidth(message) + 16; + const int screenW = g_system->getOverlayWidth(); + const int screenH = g_system->getOverlayHeight(); + const Graphics::Font *font; + GUI::WidgetSize ws; + + if (screenW >= 400 && screenH >= 300) { + ws = GUI::kBigWidgetSize; + font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); + } else { + ws = GUI::kNormalWidgetSize; + font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); + } + + int width = font->getStringWidth(message) + 16; + int height = font->getFontHeight() + 8; - _x = (320 - width) / 2; _w = width; + _h = height; + _x = (screenW - width) / 2; + _y = (screenH - height) / 2; - new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter); + new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter, ws); } #pragma mark - |