aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/player_v5m.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-11-19 08:40:51 +0100
committerTorbjörn Andersson2012-11-19 08:40:51 +0100
commit2aa8d0d65d784f0f4d9f5a8471626b5ffa046b90 (patch)
treee0752de4450f59ee351b4a1c3ff47312b9ed9968 /engines/scumm/player_v5m.cpp
parentfc0288e9d5928597b2c9f3d21ebc467b9255239d (diff)
downloadscummvm-rg350-2aa8d0d65d784f0f4d9f5a8471626b5ffa046b90.tar.gz
scummvm-rg350-2aa8d0d65d784f0f4d9f5a8471626b5ffa046b90.tar.bz2
scummvm-rg350-2aa8d0d65d784f0f4d9f5a8471626b5ffa046b90.zip
SCUMM: Try harder to find Mac Monkey Island instruments
At least for me, hfsutils turns spaces into underscores so try both "Monkey Island" and "Monkey_Island".
Diffstat (limited to 'engines/scumm/player_v5m.cpp')
-rw-r--r--engines/scumm/player_v5m.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/engines/scumm/player_v5m.cpp b/engines/scumm/player_v5m.cpp
index 254b2c7317..1cb9831621 100644
--- a/engines/scumm/player_v5m.cpp
+++ b/engines/scumm/player_v5m.cpp
@@ -86,11 +86,21 @@ Player_V5M::Player_V5M(ScummEngine *scumm, Audio::Mixer *mixer)
assert(_vm->_game.id == GID_MONKEY);
}
+// Try both with and without underscore in the filename, because hfsutils may
+// turn the space into an underscore. At least, it did for me.
+
+static const char *monkeyIslandFileNames[] = {
+ "Monkey Island",
+ "Monkey_Island"
+};
+
bool Player_V5M::checkMusicAvailable() {
Common::MacResManager resource;
- if (resource.exists("Monkey Island")) {
- return true;
+ for (int i = 0; i < ARRAYSIZE(monkeyIslandFileNames); i++) {
+ if (resource.exists(monkeyIslandFileNames[i])) {
+ return true;
+ }
}
GUI::MessageDialog dialog(_(
@@ -102,11 +112,19 @@ bool Player_V5M::checkMusicAvailable() {
bool Player_V5M::loadMusic(const byte *ptr) {
Common::MacResManager resource;
- if (!resource.open("Monkey Island")) {
- return false;
+ bool found = false;
+ uint i;
+
+ for (i = 0; i < ARRAYSIZE(monkeyIslandFileNames); i++) {
+ if (resource.open(monkeyIslandFileNames[i])) {
+ found = true;
+ break;
+ }
}
- uint i;
+ if (!found) {
+ return false;
+ }
ptr += 8;
// TODO: Decipher the unknown bytes in the header. For now, skip 'em