aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVicent Marti2008-07-10 16:37:45 +0000
committerVicent Marti2008-07-10 16:37:45 +0000
commite0aad7f4be66a9e30f0226c17c9d2bd0a8138898 (patch)
tree63d710ef171255c518f8c6321e31a3062720e7c4 /gui
parentccf9368c533110a5c72df3607466a16651ec6497 (diff)
downloadscummvm-rg350-e0aad7f4be66a9e30f0226c17c9d2bd0a8138898.tar.gz
scummvm-rg350-e0aad7f4be66a9e30f0226c17c9d2bd0a8138898.tar.bz2
scummvm-rg350-e0aad7f4be66a9e30f0226c17c9d2bd0a8138898.zip
Bugfix: Delayed loading of fonts
svn-id: r32993
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeRenderer.cpp13
-rw-r--r--gui/ThemeRenderer.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp
index 71943e2586..ca686b8583 100644
--- a/gui/ThemeRenderer.cpp
+++ b/gui/ThemeRenderer.cpp
@@ -188,6 +188,7 @@ bool ThemeRenderer::addTextStep(Common::String &drawDataId, Graphics::TextStep s
return false;
_widgets[id]->_textStep = step;
+ _widgets[id]->_textStep.font = 0;
_widgets[id]->_hasText = true;
return true;
@@ -278,11 +279,20 @@ void ThemeRenderer::drawDD(DrawData type, const Common::Rect &r) {
}
}
+void ThemeRenderer::drawDDText(DrawData type, const Common::Rect &r, const Common::String &text) {
+ if (hasWidgetText(type)) {
+ if (_widgets[type]->_textStep.font == 0)
+ _widgets[type]->_textStep.font = _font;
+
+ _vectorRenderer->textStep(text, r, _widgets[type]->_textStep);
+ }
+}
+
void ThemeRenderer::drawButton(const Common::Rect &r, const Common::String &str, WidgetStateInfo state, uint16 hints) {
if (!ready())
return;
- DrawData dd;
+ DrawData dd = kDDButtonIdle;
if (state == kStateEnabled)
dd = kDDButtonIdle;
@@ -292,6 +302,7 @@ void ThemeRenderer::drawButton(const Common::Rect &r, const Common::String &str,
dd = kDDButtonDisabled;
drawDD(dd, r);
+ drawDDText(dd, r, str);
if (hasWidgetText(dd))
_vectorRenderer->textStep(str, r, _widgets[dd]->_textStep);
diff --git a/gui/ThemeRenderer.h b/gui/ThemeRenderer.h
index 74225d035c..f2e30bae09 100644
--- a/gui/ThemeRenderer.h
+++ b/gui/ThemeRenderer.h
@@ -238,6 +238,7 @@ protected:
void drawCached(DrawData type, const Common::Rect &r);
inline void drawDD(DrawData type, const Common::Rect &r);
+ inline void drawDDText(DrawData type, const Common::Rect &r, const Common::String &text);
inline void debugWidgetPosition(const Common::Rect &r);
// TODO