From 3916b973578be838afb15493b836d55e8d68d3ae Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 8 Sep 2003 17:42:53 +0000 Subject: changes to get a better link order, and to allow building a 'bare bone' scummvm executable svn-id: r10103 --- Makefile.common | 4 ++-- common/engine.cpp | 24 +----------------------- common/gameDetector.cpp | 5 +++++ common/gameDetector.h | 4 +++- common/module.mk | 3 +-- 5 files changed, 12 insertions(+), 28 deletions(-) diff --git a/Makefile.common b/Makefile.common index bbd984350d..cc1a4f42ed 100644 --- a/Makefile.common +++ b/Makefile.common @@ -71,10 +71,10 @@ endif # After the game specific modules follow the shared modules MODULES += \ - common \ gui \ backends \ sound \ + common \ backends/fs/posix \ backends/fs/morphos \ backends/fs/windows \ @@ -98,7 +98,7 @@ CPPFLAGS:= $(DEFINES) $(INCLUDES) common/engine.o: $(OBJS) # HACK temporary fix to get compilation on OS X (and possibly others) working again -OBJS:=common/engine.o $(OBJS) +OBJS:=common/main.o common/gameDetector.o $(OBJS) scummvm$(EXEEXT): $(OBJS) $(CXX) $(LDFLAGS) -o $@ $+ $(LIBS) 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 \ -- cgit v1.2.3