diff options
author | Bastien Bouclet | 2018-06-07 20:14:27 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-06-07 20:14:27 +0200 |
commit | 3b794d263378476ca5698fa8ce57ed0887343e2c (patch) | |
tree | e88471d60b3fb3012525d31079837520b89993d9 /engines/mohawk | |
parent | b4ae4bcd8c6934e2d4927ee70d5f17ebef9b55c9 (diff) | |
download | scummvm-rg350-3b794d263378476ca5698fa8ce57ed0887343e2c.tar.gz scummvm-rg350-3b794d263378476ca5698fa8ce57ed0887343e2c.tar.bz2 scummvm-rg350-3b794d263378476ca5698fa8ce57ed0887343e2c.zip |
MOHAWK: Display a GUI error message when no audio devices are available
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/cstime.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/mohawk.cpp | 3 | ||||
-rw-r--r-- | engines/mohawk/myst.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/riven.cpp | 4 |
5 files changed, 16 insertions, 3 deletions
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index f3760a58ed..27d646fde1 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -77,6 +77,10 @@ MohawkEngine_CSTime::~MohawkEngine_CSTime() { Common::Error MohawkEngine_CSTime::run() { MohawkEngine::run(); + if (!_mixer->isReady()) { + return Common::kAudioDeviceInitFailed; + } + _console = new CSTimeConsole(this); _gfx = new CSTimeGraphics(this); _video = new VideoManager(this); diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index b9e54e4e20..eeadde1b46 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -170,6 +170,10 @@ MohawkEngine_LivingBooks::~MohawkEngine_LivingBooks() { Common::Error MohawkEngine_LivingBooks::run() { MohawkEngine::run(); + if (!_mixer->isReady()) { + return Common::kAudioDeviceInitFailed; + } + _console = new LivingBooksConsole(this); // Load the book info from the detected file loadBookInfo(getBookInfoFileName()); diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp index 52f73dbbb1..2b7e90e0c8 100644 --- a/engines/mohawk/mohawk.cpp +++ b/engines/mohawk/mohawk.cpp @@ -35,9 +35,6 @@ namespace Mohawk { MohawkEngine::MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) { - if (!_mixer->isReady()) - error ("Sound initialization failed"); - // Setup mixer syncSoundSettings(); diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index a01cfdd343..4ff1df2eb7 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -347,6 +347,10 @@ void MohawkEngine_Myst::playSoundBlocking(uint16 id) { Common::Error MohawkEngine_Myst::run() { MohawkEngine::run(); + if (!_mixer->isReady()) { + return Common::kAudioDeviceInitFailed; + } + _gfx = new MystGraphics(this); _video = new VideoManager(this); _sound = new MystSound(this); diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 8139c1a92f..648496b35e 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -114,6 +114,10 @@ GUI::Debugger *MohawkEngine_Riven::getDebugger() { Common::Error MohawkEngine_Riven::run() { MohawkEngine::run(); + if (!_mixer->isReady()) { + return Common::kAudioDeviceInitFailed; + } + // Let's try to open the installer file (it holds extras.mhk) // Though, we set a low priority to prefer the extracted version if (_installerArchive.open("arcriven.z")) |