diff options
author | Matthew Hoops | 2011-03-31 15:51:09 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-03-31 15:54:21 -0400 |
commit | 84c45eae37542685bedfe8163fd62d4fa3ee38cf (patch) | |
tree | 734ee3f381b2e63036d7313005c7d77e594a298f /engines | |
parent | e705759b7bac28dd1c00d8a655289366535bb0d1 (diff) | |
download | scummvm-rg350-84c45eae37542685bedfe8163fd62d4fa3ee38cf.tar.gz scummvm-rg350-84c45eae37542685bedfe8163fd62d4fa3ee38cf.tar.bz2 scummvm-rg350-84c45eae37542685bedfe8163fd62d4fa3ee38cf.zip |
MOHAWK: Use ScummVM GUI fonts for the cstime demo
The demo is now playable without using fonts from the full game
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/cstime_ui.cpp | 40 | ||||
-rw-r--r-- | engines/mohawk/cstime_ui.h | 6 | ||||
-rw-r--r-- | engines/mohawk/cstime_view.cpp | 4 |
3 files changed, 39 insertions, 11 deletions
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index c95e276b5e..935b0321da 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -29,6 +29,7 @@ #include "mohawk/resource.h" #include "common/algorithm.h" // find #include "common/events.h" +#include "graphics/fontman.h" namespace Mohawk { @@ -64,12 +65,15 @@ CSTimeInterface::CSTimeInterface(MohawkEngine_CSTime *vm) : _vm(vm) { _note = new CSTimeCarmenNote(_vm); _options = new CSTimeOptions(_vm); - if (!_normalFont.loadFromFON("EvP14.fon")) - error("failed to load normal font"); - if (!_dialogFont.loadFromFON("Int1212.fon")) - error("failed to load dialog font"); - if (!_rolloverFont.loadFromFON("Int1818.fon")) - error("failed to load rollover font"); + // The demo uses hardcoded system fonts + if (!(_vm->getFeatures() & GF_DEMO)) { + if (!_normalFont.loadFromFON("EvP14.fon")) + error("failed to load normal font"); + if (!_dialogFont.loadFromFON("Int1212.fon")) + error("failed to load dialog font"); + if (!_rolloverFont.loadFromFON("Int1818.fon")) + error("failed to load rollover font"); + } _uiFeature = NULL; _dialogTextFeature = NULL; @@ -91,6 +95,30 @@ CSTimeInterface::~CSTimeInterface() { delete _options; } +const Graphics::Font &CSTimeInterface::getNormalFont() const { + // HACK: Use a ScummVM GUI font in place of a system one for the demo + if (_vm->getFeatures() & GF_DEMO) + return *FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); + + return _normalFont; +} + +const Graphics::Font &CSTimeInterface::getDialogFont() const { + // HACK: Use a ScummVM GUI font in place of a system one for the demo + if (_vm->getFeatures() & GF_DEMO) + return *FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); + + return _dialogFont; +} + +const Graphics::Font &CSTimeInterface::getRolloverFont() const { + // HACK: Use a ScummVM GUI font in place of a system one for the demo + if (_vm->getFeatures() & GF_DEMO) + return *FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); + + return _rolloverFont; +} + void CSTimeInterface::cursorInstall() { _vm->getView()->loadBitmapCursors(200); } diff --git a/engines/mohawk/cstime_ui.h b/engines/mohawk/cstime_ui.h index b849ddbdfb..3ec38492d7 100644 --- a/engines/mohawk/cstime_ui.h +++ b/engines/mohawk/cstime_ui.h @@ -233,9 +233,9 @@ public: const Common::Array<Common::String> &getDialogLines() { return _dialogLines; } const Common::Array<byte> &getDialogLineColors() { return _dialogLineColors; } - const Graphics::WinFont &getNormalFont() { return _normalFont; } - const Graphics::WinFont &getDialogFont() { return _dialogFont; } - const Graphics::WinFont &getRolloverFont() { return _rolloverFont; } + const Graphics::Font &getNormalFont() const; + const Graphics::Font &getDialogFont() const; + const Graphics::Font &getRolloverFont() const; Common::Rect _sceneRect, _uiRect; Common::Rect _dialogTextRect, _bookRect, _noteRect; diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp index cad44e3b30..115b363b6e 100644 --- a/engines/mohawk/cstime_view.cpp +++ b/engines/mohawk/cstime_view.cpp @@ -537,7 +537,7 @@ void CSTimeModule::dialogTextDrawProc(Feature *feature) { const Common::Array<Common::String> &lines = _vm->getInterface()->getDialogLines(); const Common::Array<byte> &colors = _vm->getInterface()->getDialogLineColors(); const Common::Rect &bounds = feature->_data.bounds; - const Graphics::WinFont &font = _vm->getInterface()->getDialogFont(); + const Graphics::Font &font = _vm->getInterface()->getDialogFont(); Graphics::Surface *screen = _vm->_system->lockScreen(); for (uint i = 0; i < lines.size(); i++) @@ -553,7 +553,7 @@ void CSTimeModule::bubbleTextMoveProc(Feature *feature) { void CSTimeModule::bubbleTextDrawProc(Feature *feature) { Common::Rect bounds = feature->_data.bounds; bounds.grow(-5); - const Graphics::WinFont &font = _vm->getInterface()->getDialogFont(); + const Graphics::Font &font = _vm->getInterface()->getDialogFont(); uint height = font.getFontHeight(); Common::Array<Common::String> lines; |