diff options
author | Eugene Sandulenko | 2019-10-17 01:42:44 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-10-17 01:42:44 +0200 |
commit | 6100de0b3a0f869b0dc94b5f961c60206b264bf1 (patch) | |
tree | 174a062fc1899a5b0f8312e121414d8d55cec989 | |
parent | 690370554feaec28aae486816702bb108019c113 (diff) | |
download | scummvm-rg350-6100de0b3a0f869b0dc94b5f961c60206b264bf1.tar.gz scummvm-rg350-6100de0b3a0f869b0dc94b5f961c60206b264bf1.tar.bz2 scummvm-rg350-6100de0b3a0f869b0dc94b5f961c60206b264bf1.zip |
GRAPHICS: MACGUI: Add possibility to set WM mode right away
This lets us to not load mac fonts when the built-in mode in enforced
-rw-r--r-- | graphics/macgui/macfontmanager.cpp | 9 | ||||
-rw-r--r-- | graphics/macgui/macfontmanager.h | 3 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 6 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.h | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp index 05bdddc840..51c9911b06 100644 --- a/graphics/macgui/macfontmanager.cpp +++ b/graphics/macgui/macfontmanager.cpp @@ -26,6 +26,7 @@ #include "graphics/fonts/bdf.h" #include "graphics/fonts/macfont.h" +#include "graphics/macgui/macwindowmanager.h" #include "graphics/macgui/macfontmanager.h" namespace Graphics { @@ -85,12 +86,16 @@ static const char *const fontStyleSuffixes[] = { "Extend" }; -MacFontManager::MacFontManager() { +MacFontManager::MacFontManager(uint32 mode) : _mode(mode) { for (uint i = 0; i < ARRAYSIZE(fontNames); i++) if (fontNames[i]) _fontIds.setVal(fontNames[i], i); - loadFonts(); + if (_mode & MacGUIConstants::kWMModeForceBuiltinFonts) { + _builtInFonts = true; + } else { + loadFonts(); + } } void MacFontManager::loadFontsBDF() { diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h index 62972026dc..d274657bbf 100644 --- a/graphics/macgui/macfontmanager.h +++ b/graphics/macgui/macfontmanager.h @@ -102,7 +102,7 @@ private: class MacFontManager { public: - MacFontManager(); + MacFontManager(uint32 mode); /** * Accessor method to check the presence of built-in fonts. @@ -145,6 +145,7 @@ private: private: bool _builtInFonts; + uint32 _mode; Common::HashMap<Common::String, MacFont *> _fontRegistry; Common::HashMap<Common::String, int> _fontIds; diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 62d3710157..338be38050 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -147,14 +147,14 @@ static const byte macCursorCrossBar[] = { static void menuTimerHandler(void *refCon); -MacWindowManager::MacWindowManager() { +MacWindowManager::MacWindowManager(uint32 mode) { _screen = 0; _screenCopy = 0; _lastId = 0; _activeWindow = -1; _needsRemoval = false; - _mode = kWMModeNone; + _mode = mode; _menu = 0; _menuDelay = 0; @@ -175,7 +175,7 @@ MacWindowManager::MacWindowManager() { g_system->getPaletteManager()->setPalette(palette, 0, ARRAYSIZE(palette) / 3); - _fontMan = new MacFontManager(); + _fontMan = new MacFontManager(mode); CursorMan.replaceCursorPalette(palette, 0, ARRAYSIZE(palette) / 3); CursorMan.replaceCursor(macCursorArrow, 11, 16, 1, 1, 3); diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index 1719bee317..ee9fc359a2 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -98,7 +98,7 @@ void macDrawPixel(int x, int y, int color, void *data); */ class MacWindowManager { public: - MacWindowManager(); + MacWindowManager(uint32 mode = 0); ~MacWindowManager(); /** |