aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common4
-rw-r--r--common/engine.cpp24
-rw-r--r--common/gameDetector.cpp5
-rw-r--r--common/gameDetector.h4
-rw-r--r--common/module.mk3
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 \