aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-03 23:39:10 +0200
committerEugene Sandulenko2016-08-03 23:39:10 +0200
commit0cccd0ddd1d53b7d16e47a5b2d8ca62c87d992f4 (patch)
treec9c0be62f06ba7b5f7bebc69722a250a69e2203f
parent7c12e80552af036d8029b6fc197403e25a879e66 (diff)
downloadscummvm-rg350-0cccd0ddd1d53b7d16e47a5b2d8ca62c87d992f4.tar.gz
scummvm-rg350-0cccd0ddd1d53b7d16e47a5b2d8ca62c87d992f4.tar.bz2
scummvm-rg350-0cccd0ddd1d53b7d16e47a5b2d8ca62c87d992f4.zip
GRAPHICS/WAGE: Made MacWindowManager font maping requiring font size
-rw-r--r--engines/wage/dialog.cpp2
-rw-r--r--engines/wage/entities.cpp2
-rw-r--r--engines/wage/gui-console.cpp5
-rw-r--r--graphics/macgui/macwindowmanager.cpp8
-rw-r--r--graphics/macgui/macwindowmanager.h3
5 files changed, 11 insertions, 9 deletions
diff --git a/engines/wage/dialog.cpp b/engines/wage/dialog.cpp
index a2013db852..0a326817be 100644
--- a/engines/wage/dialog.cpp
+++ b/engines/wage/dialog.cpp
@@ -92,7 +92,7 @@ Dialog::~Dialog() {
}
const Graphics::Font *Dialog::getDialogFont() {
- return _gui->_wm.getFont("Chicago-12", Graphics::FontManager::kBigGUIFont);
+ return _gui->_wm.getFont(_gui->_wm.getFontName(0, 12), Graphics::FontManager::kBigGUIFont); // Default is Chicago
}
void Dialog::paint() {
diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp
index 77ab2659af..3dcf37033a 100644
--- a/engines/wage/entities.cpp
+++ b/engines/wage/entities.cpp
@@ -158,7 +158,7 @@ void Scene::paint(Graphics::ManagedSurface *surface, int x, int y) {
}
const char *Scene::getFontName() {
- const char *name = ((WageEngine *)g_engine)->_gui->_wm.getFontName(_fontType);
+ const char *name = ((WageEngine *)g_engine)->_gui->_wm.getFontName(_fontType, _fontSize);
if (!name)
return "Unknown";
diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp
index 1cf98ab991..2b364d3657 100644
--- a/engines/wage/gui-console.cpp
+++ b/engines/wage/gui-console.cpp
@@ -63,12 +63,9 @@
namespace Wage {
const Graphics::Font *Gui::getConsoleFont() {
- char fontName[128];
Scene *scene = _engine->_world->_player->_currentScene;
- snprintf(fontName, 128, "%s-%d", scene->getFontName(), scene->_fontSize);
-
- return _wm.getFont(fontName, Graphics::FontManager::kConsoleFont);
+ return _wm.getFont(scene->getFontName(), Graphics::FontManager::kConsoleFont);
}
void Gui::clearOutput() {
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 516eb84bf8..d19e40781f 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -452,11 +452,15 @@ static const char *const fontNames[] = {
"New Century Schoolbook"
};
-const char *MacWindowManager::getFontName(int id) {
+const char *MacWindowManager::getFontName(int id, int size) {
+ static char name[128];
+
if (id > ARRAYSIZE(fontNames))
return NULL;
- return fontNames[id];
+ snprintf(name, 128, "%s-%d", fontNames[id], size);
+
+ return name;
}
/////////////////
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 3c1d89ddde..cb432d9699 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -118,9 +118,10 @@ public:
/**
* Return font name from standard ID
* @param id ID of the font
+ * @param size size of the font
* @return the font name or NULL if ID goes beyond the mapping
*/
- const char *getFontName(int id);
+ const char *getFontName(int id, int size);
/**
* Create a window with the given parameters.