aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-10-12 16:54:40 -0400
committerPaul Gilbert2014-10-12 16:54:40 -0400
commitf978539cbc82066a5cdedfefddb539b11e60369a (patch)
tree0e0d7597a86013222f3aabbd05823929ccae9c4d /engines
parentd02693cb0c65b48934aed8c61c9926e9d06ac11c (diff)
downloadscummvm-rg350-f978539cbc82066a5cdedfefddb539b11e60369a.tar.gz
scummvm-rg350-f978539cbc82066a5cdedfefddb539b11e60369a.tar.bz2
scummvm-rg350-f978539cbc82066a5cdedfefddb539b11e60369a.zip
MADS: Move OPL creation from the engine to SoundManager
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/mads.cpp7
-rw-r--r--engines/mads/mads.h1
-rw-r--r--engines/mads/sound.cpp9
-rw-r--r--engines/mads/sound.h2
4 files changed, 9 insertions, 10 deletions
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index d56994ab8e..52a0b40561 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -55,7 +55,6 @@ MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
_resources = nullptr;
_sound = nullptr;
_audio = nullptr;
- _opl = nullptr;
}
MADSEngine::~MADSEngine() {
@@ -71,7 +70,6 @@ MADSEngine::~MADSEngine() {
delete _audio;
_mixer->stopAll();
- delete _opl;
}
void MADSEngine::initialize() {
@@ -80,9 +78,6 @@ void MADSEngine::initialize() {
DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
- _opl = OPL::Config::create();
- _opl->init(11025);
-
// Initial sub-system engine references
MSurface::setVm(this);
MSprite::setVm(this);
@@ -96,7 +91,7 @@ void MADSEngine::initialize() {
Font::init(this);
_font = new Font();
_screen.init();
- _sound = new SoundManager(this, _mixer, _opl);
+ _sound = new SoundManager(this, _mixer);
_audio = new AudioPlayer(_mixer, getGameID());
_game = Game::init(this);
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index 8fc2788c28..9a8f2152a1 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -99,7 +99,6 @@ public:
ScreenSurface _screen;
SoundManager *_sound;
AudioPlayer *_audio;
- FM_OPL *_opl;
bool _easyMouse;
bool _invObjectsAnimated;
bool _textWindowStill;
diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp
index 12109895b5..9d0d9c8d20 100644
--- a/engines/mads/sound.cpp
+++ b/engines/mads/sound.cpp
@@ -29,18 +29,23 @@
namespace MADS {
-SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer, FM_OPL *opl) {
+SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) {
_vm = vm;
_mixer = mixer;
- _opl = opl;
_driver = nullptr;
_pollSoundEnabled = false;
_soundPollFlag = false;
_newSoundsPaused = false;
+
+ _opl = OPL::Config::create();
+ _opl->init(11025);
}
SoundManager::~SoundManager() {
+ _driver->stop();
+
delete _driver;
+ delete _opl;
}
void SoundManager::init(int sectionNumber) {
diff --git a/engines/mads/sound.h b/engines/mads/sound.h
index b2af7e2346..72bb21a812 100644
--- a/engines/mads/sound.h
+++ b/engines/mads/sound.h
@@ -44,7 +44,7 @@ private:
bool _newSoundsPaused;
Common::Queue<int> _queuedCommands;
public:
- SoundManager(MADSEngine *vm, Audio::Mixer *mixer, FM_OPL *opl);
+ SoundManager(MADSEngine *vm, Audio::Mixer *mixer);
~SoundManager();
/**