From f5b4f96404d8f47b526908cc60042b5ae11adf03 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 21 Jan 2011 11:53:44 +0000 Subject: MOHAWK: De-hardcode CSTime font paths. The original Broderbund release had the installer data in a different directory. svn-id: r55372 --- engines/mohawk/cstime.cpp | 9 +++++++++ engines/mohawk/cstime_ui.cpp | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 36599c9d33..6ca824a143 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -33,8 +33,10 @@ #include "mohawk/sound.h" #include "mohawk/video.h" +#include "common/config-manager.h" #include "common/events.h" #include "common/EventRecorder.h" +#include "common/fs.h" #include "engines/util.h" @@ -44,6 +46,13 @@ MohawkEngine_CSTime::MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescript _rnd = new Common::RandomSource(); g_eventRec.registerRandomSource(*_rnd, "cstime"); + // If the user just copied the CD contents, the fonts are in a subdirectory. + const Common::FSNode gameDataDir(ConfMan.get("path")); + // They're in setup/data32 for 'Where in Time is Carmen Sandiego?'. + SearchMan.addSubDirectoryMatching(gameDataDir, "setup/data32"); + // They're in 95instal for 'Carmen Sandiego's Great Chase Through Time'. + SearchMan.addSubDirectoryMatching(gameDataDir, "95instal"); + _state = kCSTStateStartup; reset(); diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index 19c3ccc3da..50e0c64a91 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -63,11 +63,11 @@ CSTimeInterface::CSTimeInterface(MohawkEngine_CSTime *vm) : _vm(vm) { _note = new CSTimeCarmenNote(_vm); _options = new CSTimeOptions(_vm); - if (!_normalFont.loadFromFON("95instal/EvP14.fon")) + if (!_normalFont.loadFromFON("EvP14.fon")) error("failed to load normal font"); - if (!_dialogFont.loadFromFON("95instal/Int1212.fon")) + if (!_dialogFont.loadFromFON("Int1212.fon")) error("failed to load dialog font"); - if (!_rolloverFont.loadFromFON("95instal/Int1818.fon")) + if (!_rolloverFont.loadFromFON("Int1818.fon")) error("failed to load rollover font"); _uiFeature = NULL; -- cgit v1.2.3