Skip to content

Commit

Permalink
SCUMM: Simplify checkMusicAvailable() a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Torbjörn Andersson committed Nov 19, 2012
1 parent 9e99599 commit fc0288e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
18 changes: 6 additions & 12 deletions engines/scumm/player_v3m.cpp
Expand Up @@ -118,24 +118,18 @@ static const char *loomFileNames[] = {

bool Player_V3M::checkMusicAvailable() {
Common::MacResManager resource;
bool found = false;

for (int i = 0; i < ARRAYSIZE(loomFileNames); i++) {
if (resource.exists(loomFileNames[i])) {
found = true;
break;
return true;
}
}

if (!found) {
GUI::MessageDialog dialog(_(
"Could not find the 'Loom' Macintosh executable to read the\n"
"instruments from. Music will be disabled."), _("OK"));
dialog.runModal();
return false;
}

return true;
GUI::MessageDialog dialog(_(
"Could not find the 'Loom' Macintosh executable to read the\n"
"instruments from. Music will be disabled."), _("OK"));
dialog.runModal();
return false;
}

bool Player_V3M::loadMusic(const byte *ptr) {
Expand Down
15 changes: 8 additions & 7 deletions engines/scumm/player_v5m.cpp
Expand Up @@ -88,15 +88,16 @@ Player_V5M::Player_V5M(ScummEngine *scumm, Audio::Mixer *mixer)

bool Player_V5M::checkMusicAvailable() {
Common::MacResManager resource;
if (!resource.exists("Monkey Island")) {
GUI::MessageDialog dialog(_(
"Could not find the 'Monkey Island' Macintosh executable to read the\n"
"instruments from. Music will be disabled."), _("OK"));
dialog.runModal();
return false;

if (resource.exists("Monkey Island")) {
return true;
}

return true;
GUI::MessageDialog dialog(_(
"Could not find the 'Monkey Island' Macintosh executable to read the\n"
"instruments from. Music will be disabled."), _("OK"));
dialog.runModal();
return false;
}

bool Player_V5M::loadMusic(const byte *ptr) {
Expand Down

0 comments on commit fc0288e

Please sign in to comment.