diff options
author | Max Horn | 2003-05-24 22:17:45 +0000 |
---|---|---|
committer | Max Horn | 2003-05-24 22:17:45 +0000 |
commit | 0384d27e83f2943279b8350bef8ddc82619b1eee (patch) | |
tree | 1dc75dc3a78c8c1c8a6ace09f98a7bce5f7f7785 /scumm/scummvm.cpp | |
parent | 4cda099c575e15ff68239746f3b2076b1aad432f (diff) | |
download | scummvm-rg350-0384d27e83f2943279b8350bef8ddc82619b1eee.tar.gz scummvm-rg350-0384d27e83f2943279b8350bef8ddc82619b1eee.tar.bz2 scummvm-rg350-0384d27e83f2943279b8350bef8ddc82619b1eee.zip |
(somewhat hackish) support for COMI CD changing on Mac OS X; reordered stuff in scumm.h
svn-id: r7908
Diffstat (limited to 'scumm/scummvm.cpp')
-rw-r--r-- | scumm/scummvm.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index fd5fa8a79f..bb7db94030 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -42,6 +42,10 @@ #include "gui/message.h" #include "sound/mixer.h" #include "sound/mididrv.h" +#ifdef MACOSX +#include <sys/types.h> +#include <sys/stat.h> +#endif #ifdef _WIN32_WCE extern void drawError(char*); @@ -2006,6 +2010,35 @@ int normalizeAngle(int angle) { return toSimpleDir(1, temp) * 45; } +const char *Scumm::getGameDataPath() const { +#ifdef MACOSX + if (_features & GF_AFTER_V8 && !memcmp(_gameDataPath, "/Volumes/MONKEY3_", 17)) { + // Special case for COMI on Mac OS X. The mount points on OS X depend + // on the volume name. Hence if playing from CD, we'd get a problem. + // So if loading of a resource file fails, we fall back to the (fixed) + // CD mount points (/Volumes/MONKEY3_1 and /Volumes/MONKEY3_2). + // + // The check for whether we play from CD or not is very hackish, though. + static char buf[256]; + struct stat st; + int disk = (_scummVars && _scummVars[VAR_CURRENTDISK] == 2) ? 2 : 1; + sprintf(buf, "/Volumes/MONKEY3_%d", disk); + + if (!stat(buf, &st)) { + return buf; + } + + // Apparently that disk is not inserted. However since many data files + // (fonts, comi.la0) are on both disks, we also try the other CD. + disk = (disk == 1) ? 2 : 1; + sprintf(buf, "/Volumes/MONKEY3_%d", disk); + return buf; + } +#endif + + return _gameDataPath; +} + void Scumm::errorString(const char *buf1, char *buf2) { if (_currentScript != 0xFF) { ScriptSlot *ss = &vm.slot[_currentScript]; |