diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/engine.cpp | 24 | ||||
| -rw-r--r-- | common/gameDetector.cpp | 5 | ||||
| -rw-r--r-- | common/gameDetector.h | 4 | ||||
| -rw-r--r-- | common/module.mk | 3 | 
4 files changed, 10 insertions, 26 deletions
diff --git a/common/engine.cpp b/common/engine.cpp index 0ceb7e5751..4605b49a46 100644 --- a/common/engine.cpp +++ b/common/engine.cpp @@ -78,7 +78,7 @@ Engine *g_engine = 0;  Engine::Engine(GameDetector *detector, OSystem *syst)  	: _system(syst) {  	g_engine = this; -	_mixer = new SoundMixer(); +	_mixer = detector->createMixer();  	_gameDataPath = detector->_gameDataPath; @@ -240,25 +240,3 @@ void checkHeap() {  	}  #endif  } - -// -// HACK: The following is done to pull in symbols from all the engine modules here. -// If we don't do this, all sorts of linker problems may occur. -// -EngineFactory _factories[] = -	{ -#ifndef DISABLE_SCUMM -		Engine_SCUMM_create, -#endif -#ifndef DISABLE_SCUMM -		Engine_SIMON_create, -#endif -#ifndef DISABLE_SCUMM -		Engine_SKY_create, -#endif -#ifndef DISABLE_SCUMM -		Engine_SWORD2_create, -#endif -		0 -	}; - diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 3e49768486..fac5292b19 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -28,6 +28,7 @@  #include "common/plugins.h"  #include "common/scaler.h"	// Only for gfx_modes  #include "sound/mididrv.h" +#include "sound/mixer.h"  #if defined(HAVE_CONFIG_H)  #include "config.h" @@ -801,6 +802,10 @@ int GameDetector::getMidiDriverType() {      return MD_NULL;  } +SoundMixer *GameDetector::createMixer() { +	return new SoundMixer(); +} +  MidiDriver *GameDetector::createMidi() {  	int drv = getMidiDriverType(); diff --git a/common/gameDetector.h b/common/gameDetector.h index 1443a9ceb4..dd6f12964d 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -27,8 +27,9 @@  class Engine;  class GameDetector; -class OSystem;  class MidiDriver; +class OSystem; +class SoundMixer;  /** Default sound/music volumes.   * @todo move this to a better place. @@ -183,6 +184,7 @@ public:  	OSystem *createSystem();  	Engine *createEngine(OSystem *system); +	SoundMixer *createMixer();  	MidiDriver *createMidi();  	int getMidiDriverType(); diff --git a/common/module.mk b/common/module.mk index 411ee17926..34304cc7ad 100644 --- a/common/module.mk +++ b/common/module.mk @@ -2,9 +2,8 @@ MODULE := common  MODULE_OBJS = \  	common/config-file.o \ +	common/engine.o \  	common/file.o \ -	common/gameDetector.o \ -	common/main.o \  	common/plugins.o \  	common/scaler.o \  	common/str.o \  | 
