aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-11-19 07:25:42 +0100
committerTorbjörn Andersson2012-11-19 07:25:42 +0100
commitfc0288e9d5928597b2c9f3d21ebc467b9255239d (patch)
treed9a247e7ac07ec5a0bb97cdf558737225e560e7b /engines/scumm
parent9e995991e7598f235392700f808ed8aebdc64b75 (diff)
downloadscummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.tar.gz
scummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.tar.bz2
scummvm-rg350-fc0288e9d5928597b2c9f3d21ebc467b9255239d.zip
SCUMM: Simplify checkMusicAvailable() a bit
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/player_v3m.cpp18
-rw-r--r--engines/scumm/player_v5m.cpp15
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) {