[Scummvm-git-logs] scummvm master -> b1da6a74c5dc22b42606649059bb35722010cc31
bgK
bastien.bouclet at gmail.com
Thu Jun 7 20:28:29 CEST 2018
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3b794d2633 MOHAWK: Display a GUI error message when no audio devices are available
b1da6a74c5 DIRECTOR: Show a GUI error message when no sound devices are available
Commit: 3b794d263378476ca5698fa8ce57ed0887343e2c
https://github.com/scummvm/scummvm/commit/3b794d263378476ca5698fa8ce57ed0887343e2c
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-06-07T20:14:27+02:00
Commit Message:
MOHAWK: Display a GUI error message when no audio devices are available
Changed paths:
common/error.cpp
common/error.h
engines/mohawk/cstime.cpp
engines/mohawk/livingbooks.cpp
engines/mohawk/mohawk.cpp
engines/mohawk/myst.cpp
engines/mohawk/riven.cpp
diff --git a/common/error.cpp b/common/error.cpp
index bbbcb7c..1c3b515 100644
--- a/common/error.cpp
+++ b/common/error.cpp
@@ -42,6 +42,8 @@ static String errorToString(ErrorCode errorCode) {
return _s("Game id not supported");
case kUnsupportedColorMode:
return _s("Unsupported color mode");
+ case kAudioDeviceInitFailed:
+ return _s("Audio device initialization failed");
case kReadPermissionDenied:
return _s("Read permission denied");
diff --git a/common/error.h b/common/error.h
index 3e0a7b5..00495e0 100644
--- a/common/error.h
+++ b/common/error.h
@@ -46,6 +46,7 @@ enum ErrorCode {
kNoGameDataFoundError, ///< Engine initialization: No game data was found in the specified location
kUnsupportedGameidError, ///< Engine initialization: Gameid not supported by this (Meta)Engine
kUnsupportedColorMode, ///< Engine initialization: Engine does not support backend's color mode
+ kAudioDeviceInitFailed, ///< Engine initialization: Audio device initialization failed
kReadPermissionDenied, ///< Unable to read data due to missing read permission
kWritePermissionDenied, ///< Unable to write data due to missing write permission
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index f3760a5..27d646f 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 b9e54e4..eeadde1 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 52f73db..2b7e90e 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 a01cfdd..4ff1df2 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 8139c1a..648496b 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"))
Commit: b1da6a74c5dc22b42606649059bb35722010cc31
https://github.com/scummvm/scummvm/commit/b1da6a74c5dc22b42606649059bb35722010cc31
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-06-07T20:24:39+02:00
Commit Message:
DIRECTOR: Show a GUI error message when no sound devices are available
Changed paths:
engines/director/director.cpp
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index ec35022..f2ad5db 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -50,9 +50,6 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
g_director = this;
- if (!_mixer->isReady())
- error("Sound initialization failed");
-
// Setup mixer
syncSoundSettings();
@@ -116,6 +113,10 @@ DirectorEngine::~DirectorEngine() {
Common::Error DirectorEngine::run() {
debug("Starting v%d Director game", getVersion());
+ if (!_mixer->isReady()) {
+ return Common::kAudioDeviceInitFailed;
+ }
+
_currentPalette = nullptr;
_macBinary = nullptr;
More information about the Scummvm-git-logs
mailing list