diff options
author | Matthew Hoops | 2011-05-12 21:30:09 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-12 21:30:09 -0400 |
commit | d85dc010edb88f42493f434887fd45f29c213afd (patch) | |
tree | 1e625f3d8c3f5eadc5c59db1ea126a629234eb2a /engines/pegasus | |
parent | 760f50f034b54d7e109692b4d5219560b065cf3a (diff) | |
download | scummvm-rg350-d85dc010edb88f42493f434887fd45f29c213afd.tar.gz scummvm-rg350-d85dc010edb88f42493f434887fd45f29c213afd.tar.bz2 scummvm-rg350-d85dc010edb88f42493f434887fd45f29c213afd.zip |
PEGASUS: Add support for using the original 'Opening/Closing' directory
Diffstat (limited to 'engines/pegasus')
-rw-r--r-- | engines/pegasus/menu.cpp | 2 | ||||
-rw-r--r-- | engines/pegasus/pegasus.cpp | 56 | ||||
-rw-r--r-- | engines/pegasus/pegasus.h | 4 |
3 files changed, 56 insertions, 6 deletions
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp index dd32e36c0e..33e8df3f6b 100644 --- a/engines/pegasus/menu.cpp +++ b/engines/pegasus/menu.cpp @@ -119,7 +119,7 @@ void PegasusEngine::runMainMenu() { // Too slow! Go back and show the intro again. _sound->stopSound(); - _video->playMovie("Images/Opening_Closing/LilMovie.movie"); + _video->playMovie(_introDirectory + "/LilMovie.movie"); _gameMode = kIntroMode; } diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index ae83a058c6..a3a3822338 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -24,6 +24,7 @@ #include "common/error.h" #include "common/events.h" #include "common/file.h" +#include "common/fs.h" #include "common/textconsole.h" #include "common/translation.h" #include "base/plugins.h" @@ -73,6 +74,21 @@ Common::Error PegasusEngine::run() { loadItemLocationData(); + if (!detectOpeningClosingDirectory()) { + Common::String message = "Missing intro directory. "; + + // Give Mac OS X a more specific message because we can +#ifdef MACOSX + message += "Make sure \"Opening/Closing\" is present."; +#else + message += "Be sure to rename \"Opening/Closing\" to \"Opening_Closing\"."; +#endif + + GUIErrorMessage(message); + warning("%s", message.c_str()); + return Common::kNoGameDataFoundError; + } + #if 0 Common::MacResIDArray pictIds = _biochipLid->getResIDArray(MKID_BE('PICT')); for (uint32 i = 0; i < pictIds.size(); i++) { @@ -138,6 +154,39 @@ Common::Error PegasusEngine::run() { return Common::kNoError; } +bool PegasusEngine::detectOpeningClosingDirectory() { + // We need to detect what our Opening/Closing directory is listed as + // On the original disc, it was 'Opening/Closing' but only HFS(+) supports the slash + // Mac OS X will display this as 'Opening:Closing' and we can use that directly + // On other systems, users will need to rename to "Opening_Closing" + + Common::FSNode gameDataDir(ConfMan.get("path")); + gameDataDir = gameDataDir.getChild("Images"); + + if (!gameDataDir.exists()) + return false; + + Common::FSList fsList; + if (!gameDataDir.getChildren(fsList, Common::FSNode::kListDirectoriesOnly, true)) + return false; + + for (uint i = 0; i < fsList.size() && _introDirectory.empty(); i++) { + Common::String name = fsList[i].getName(); + + if (name.equalsIgnoreCase("Opening:Closing")) + _introDirectory = name; + else if (name.equalsIgnoreCase("Opening_Closing")) + _introDirectory = name; + } + + if (_introDirectory.empty()) + return false; + + debug(0, "Detected intro location as '%s'", _introDirectory.c_str()); + _introDirectory = Common::String("Images/") + _introDirectory; + return true; +} + void PegasusEngine::loadItemLocationData() { Common::SeekableReadStream *res = _resFork->getResource(MKTAG('N', 'I', 't', 'm'), 0x80); @@ -158,11 +207,8 @@ void PegasusEngine::loadItemLocationData() { } void PegasusEngine::runIntro() { - // The Opening/Closing folder will need to be renamed to something else. Windows - // and other OS's/FS's do not support a '/' in the filename. I arbitrarily chose - // to rename my folder with the underscore. - _video->playMovieCentered("Images/Opening_Closing/BandaiLogo.movie"); - VideoHandle handle = _video->playBackgroundMovie("Images/Opening_Closing/Big Movie.movie"); + _video->playMovieCentered(_introDirectory + "/BandaiLogo.movie"); + VideoHandle handle = _video->playBackgroundMovie(_introDirectory + "/Big Movie.movie"); _video->seekToTime(handle, 10 * 600); _video->waitUntilMovieEnds(handle); } diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index 2e07862c30..ee5dc76a92 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -262,6 +262,10 @@ private: // Console PegasusConsole *_console; + + // Intro Directory Code + bool detectOpeningClosingDirectory(); + Common::String _introDirectory; }; } // End of namespace Pegasus |