[Scummvm-cvs-logs] scummvm master -> f978539cbc82066a5cdedfefddb539b11e60369a

dreammaster dreammaster at scummvm.org
Sun Oct 12 22:55:27 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f978539cbc MADS: Move OPL creation from the engine to SoundManager


Commit: f978539cbc82066a5cdedfefddb539b11e60369a
    https://github.com/scummvm/scummvm/commit/f978539cbc82066a5cdedfefddb539b11e60369a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-12T16:54:40-04:00

Commit Message:
MADS: Move OPL creation from the engine to SoundManager

Changed paths:
    engines/mads/mads.cpp
    engines/mads/mads.h
    engines/mads/sound.cpp
    engines/mads/sound.h



diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index d56994a..52a0b40 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 8fc2788..9a8f215 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 1210989..9d0d9c8 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 b2af7e234..72bb21a 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();
 
 	/**






More information about the Scummvm-git-logs mailing list