diff options
author | Torbjörn Andersson | 2012-11-19 07:25:42 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2012-11-19 07:25:42 +0100 |
commit | fc0288e9d5928597b2c9f3d21ebc467b9255239d (patch) | |
tree | d9a247e7ac07ec5a0bb97cdf558737225e560e7b | |
parent | 9e995991e7598f235392700f808ed8aebdc64b75 (diff) | |
download | scummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.tar.gz scummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.tar.bz2 scummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.zip |
SCUMM: Simplify checkMusicAvailable() a bit
-rw-r--r-- | engines/scumm/player_v3m.cpp | 18 | ||||
-rw-r--r-- | engines/scumm/player_v5m.cpp | 15 |
2 files changed, 14 insertions, 19 deletions
diff --git a/engines/scumm/player_v3m.cpp b/engines/scumm/player_v3m.cpp index 6a675f2ca8..35d2aaac89 100644 --- a/engines/scumm/player_v3m.cpp +++ b/engines/scumm/player_v3m.cpp @@ -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) { diff --git a/engines/scumm/player_v5m.cpp b/engines/scumm/player_v5m.cpp index 26cfb0e7c1..254b2c7317 100644 --- a/engines/scumm/player_v5m.cpp +++ b/engines/scumm/player_v5m.cpp @@ -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) { |