aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/cstime.cpp3
-rw-r--r--engines/mohawk/cstime.h1
-rw-r--r--engines/mohawk/livingbooks.cpp3
-rw-r--r--engines/mohawk/livingbooks.h1
-rw-r--r--engines/mohawk/mohawk.cpp9
-rw-r--r--engines/mohawk/mohawk.h1
-rw-r--r--engines/mohawk/myst.cpp3
-rw-r--r--engines/mohawk/myst.h1
-rw-r--r--engines/mohawk/riven.cpp3
-rw-r--r--engines/mohawk/riven.h1
-rw-r--r--engines/mohawk/sound.cpp22
-rw-r--r--engines/mohawk/sound.h4
12 files changed, 18 insertions, 34 deletions
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index 3b26378819..b2889be714 100644
--- a/engines/mohawk/cstime.cpp
+++ b/engines/mohawk/cstime.cpp
@@ -54,6 +54,7 @@ MohawkEngine_CSTime::MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescript
_console = 0;
_gfx = 0;
+ _sound = 0;
_cursor = 0;
_interface = 0;
_view = 0;
@@ -66,6 +67,7 @@ MohawkEngine_CSTime::~MohawkEngine_CSTime() {
delete _interface;
delete _view;
delete _console;
+ delete _sound;
delete _gfx;
delete _rnd;
}
@@ -75,6 +77,7 @@ Common::Error MohawkEngine_CSTime::run() {
_console = new CSTimeConsole(this);
_gfx = new CSTimeGraphics(this);
+ _sound = new Sound(this);
_cursor = new DefaultCursorManager(this, ID_CURS);
_interface = new CSTimeInterface(this);
diff --git a/engines/mohawk/cstime.h b/engines/mohawk/cstime.h
index bfb7daf945..393032aaa9 100644
--- a/engines/mohawk/cstime.h
+++ b/engines/mohawk/cstime.h
@@ -136,6 +136,7 @@ public:
Common::RandomSource *_rnd;
+ Sound *_sound;
CSTimeGraphics *_gfx;
bool _needsUpdate;
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 5af8fac901..579e3792b3 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -144,6 +144,7 @@ MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGa
_rnd = new Common::RandomSource("livingbooks");
+ _sound = NULL;
_page = NULL;
const Common::FSNode gameDataDir(ConfMan.get("path"));
@@ -158,6 +159,7 @@ MohawkEngine_LivingBooks::~MohawkEngine_LivingBooks() {
destroyPage();
delete _console;
+ delete _sound;
delete _gfx;
delete _rnd;
_bookInfoFile.clear();
@@ -182,6 +184,7 @@ Common::Error MohawkEngine_LivingBooks::run() {
error("Could not find xRes/yRes variables");
_gfx = new LBGraphics(this, _screenWidth, _screenHeight);
+ _sound = new Sound(this);
if (getGameType() != GType_LIVINGBOOKSV1)
_cursor = new LivingBooksCursorManager_v2();
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 1a265a1a02..cf67c1ee8e 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -714,6 +714,7 @@ public:
Common::RandomSource *_rnd;
+ Sound *_sound;
LBGraphics *_gfx;
bool _needsRedraw, _needsUpdate;
diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp
index d740d9479a..b38409f9f1 100644
--- a/engines/mohawk/mohawk.cpp
+++ b/engines/mohawk/mohawk.cpp
@@ -40,14 +40,12 @@ MohawkEngine::MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc)
// Setup mixer
syncSoundSettings();
- _sound = 0;
_video = 0;
_pauseDialog = 0;
_cursor = 0;
}
MohawkEngine::~MohawkEngine() {
- delete _sound;
delete _video;
delete _pauseDialog;
delete _cursor;
@@ -58,7 +56,6 @@ MohawkEngine::~MohawkEngine() {
}
Common::Error MohawkEngine::run() {
- _sound = new Sound(this);
_video = new VideoManager(this);
_pauseDialog = new PauseDialog(this, "The game is paused. Press any key to continue.");
@@ -66,14 +63,12 @@ Common::Error MohawkEngine::run() {
}
void MohawkEngine::pauseEngineIntern(bool pause) {
+ Engine::pauseEngineIntern(pause);
+
if (pause) {
_video->pauseVideos();
- _sound->pauseSound();
- _sound->pauseSLST();
} else {
_video->resumeVideos();
- _sound->resumeSound();
- _sound->resumeSLST();
_system->updateScreen();
}
}
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index ac91dca971..bc0d642bce 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -100,7 +100,6 @@ public:
bool hasFeature(EngineFeature f) const;
- Sound *_sound;
VideoManager *_video;
CursorManager *_cursor;
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index a1c6d0e748..3c00c1e11b 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -75,6 +75,7 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription
_curResource = -1;
_hoverResource = nullptr;
+ _sound = nullptr;
_gfx = nullptr;
_console = nullptr;
_scriptParser = nullptr;
@@ -88,6 +89,7 @@ MohawkEngine_Myst::~MohawkEngine_Myst() {
DebugMan.clearAllDebugChannels();
delete _gfx;
+ delete _sound;
delete _console;
delete _scriptParser;
delete _gameState;
@@ -220,6 +222,7 @@ Common::Error MohawkEngine_Myst::run() {
MohawkEngine::run();
_gfx = new MystGraphics(this);
+ _sound = new Sound(this);
_console = new MystConsole(this);
_gameState = new MystGameState(this, _saveFileMan);
_optionsDialog = new MystOptionsDialog(this);
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 0b249e5499..0491e853b6 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -200,6 +200,7 @@ public:
bool _showResourceRects;
+ Sound *_sound;
MystGraphics *_gfx;
MystGameState *_gameState;
MystScriptParser *_scriptParser;
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index b05b76da30..054b6ca6bc 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -59,6 +59,7 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio
_curStack = kStackUnknown;
_hotspots = nullptr;
_gfx = nullptr;
+ _sound = nullptr;
_externalScriptHandler = nullptr;
_rnd = nullptr;
_scriptMan = nullptr;
@@ -92,6 +93,7 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio
}
MohawkEngine_Riven::~MohawkEngine_Riven() {
+ delete _sound;
delete _gfx;
delete _console;
delete _externalScriptHandler;
@@ -123,6 +125,7 @@ Common::Error MohawkEngine_Riven::run() {
SearchMan.add("arcriven.z", &_installerArchive, 0, false);
_gfx = new RivenGraphics(this);
+ _sound = new Sound(this);
_console = new RivenConsole(this);
_saveLoad = new RivenSaveLoad(this, _saveFileMan);
_externalScriptHandler = new RivenExternal(this);
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index 3ea50bb38d..4e52dfbc93 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -121,6 +121,7 @@ public:
MohawkEngine_Riven(OSystem *syst, const MohawkGameDescription *gamedesc);
virtual ~MohawkEngine_Riven();
+ Sound *_sound;
RivenGraphics *_gfx;
RivenExternal *_externalScriptHandler;
Common::RandomSource *_rnd;
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index e52122dce0..dd9325250d 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -518,16 +518,6 @@ void Sound::stopSLSTSound(uint16 index, bool fade) {
_currentSLSTSounds.remove_at(index);
}
-void Sound::pauseSLST() {
- for (uint16 i = 0; i < _currentSLSTSounds.size(); i++)
- _vm->_mixer->pauseHandle(*_currentSLSTSounds[i].handle, true);
-}
-
-void Sound::resumeSLST() {
- for (uint16 i = 0; i < _currentSLSTSounds.size(); i++)
- _vm->_mixer->pauseHandle(*_currentSLSTSounds[i].handle, false);
-}
-
Audio::RewindableAudioStream *Sound::makeLivingBooksWaveStream_v1(Common::SeekableReadStream *stream) {
uint16 header = stream->readUint16BE();
uint16 rate = 0;
@@ -591,18 +581,6 @@ void Sound::stopSound(uint16 id) {
}
}
-void Sound::pauseSound() {
- for (uint32 i = 0; i < _handles.size(); i++)
- if (_handles[i].type == kUsedHandle)
- _vm->_mixer->pauseHandle(_handles[i].handle, true);
-}
-
-void Sound::resumeSound() {
- for (uint32 i = 0; i < _handles.size(); i++)
- if (_handles[i].type == kUsedHandle)
- _vm->_mixer->pauseHandle(_handles[i].handle, false);
-}
-
bool Sound::isPlaying(uint16 id) {
for (uint32 i = 0; i < _handles.size(); i++)
if (_handles[i].type == kUsedHandle && _handles[i].id == id)
diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h
index a02c0d1ccb..6b50c411c2 100644
--- a/engines/mohawk/sound.h
+++ b/engines/mohawk/sound.h
@@ -132,8 +132,6 @@ public:
void stopMidi();
void stopSound();
void stopSound(uint16 id);
- void pauseSound();
- void resumeSound();
bool isPlaying(uint16 id);
bool isPlaying();
uint getNumSamplesPlayed(uint16 id);
@@ -149,8 +147,6 @@ public:
// Riven-specific sound functions
void playSLST(uint16 index, uint16 card);
void playSLST(SLSTRecord slstRecord);
- void pauseSLST();
- void resumeSLST();
void stopAllSLST(bool fade = false);
static byte convertRivenVolume(uint16 volume);