From b32748d81050f66b343b4e028207c2472de49d01 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 19 Dec 2009 16:05:47 +0000 Subject: - Removed unused includes - Added a new method for constructing a new MidiDriver in the Adlib driver - Added a hack to obtain the resource manager in the default open() method of the overriden Adlib MIDI driver (used in the new sound code) svn-id: r46420 --- engines/sci/sfx/softseq/adlib.cpp | 5 ++++- engines/sci/sfx/softseq/mididriver.h | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/sci/sfx') diff --git a/engines/sci/sfx/softseq/adlib.cpp b/engines/sci/sfx/softseq/adlib.cpp index efc5c4b823..7638eb0b8d 100644 --- a/engines/sci/sfx/softseq/adlib.cpp +++ b/engines/sci/sfx/softseq/adlib.cpp @@ -24,7 +24,6 @@ */ #include "sci/sci.h" -#include "sci/sfx/iterator.h" #include "sound/fmopl.h" #include "sound/softsynth/emumidi.h" @@ -812,4 +811,8 @@ MidiPlayer *MidiPlayer_Adlib_create() { return new MidiPlayer_Adlib(); } +MidiDriver *MidiDriver_Adlib_create() { + return new MidiDriver_Adlib(g_system->getMixer()); +} + } // End of namespace Sci diff --git a/engines/sci/sfx/softseq/mididriver.h b/engines/sci/sfx/softseq/mididriver.h index 01ed3f6573..cded8ab095 100644 --- a/engines/sci/sfx/softseq/mididriver.h +++ b/engines/sci/sfx/softseq/mididriver.h @@ -26,6 +26,7 @@ #ifndef SCI_SFX_SOFTSEQ_MIDIDRIVER_H #define SCI_SFX_SOFTSEQ_MIDIDRIVER_H +#include "sci/sci.h" #include "sound/mididrv.h" #include "sound/softsynth/emumidi.h" #include "common/error.h" @@ -67,7 +68,10 @@ class MidiPlayer : public MidiDriver { protected: MidiDriver *_driver; public: - int open() { return open(NULL); } + int open() { + ResourceManager *resMan = ((SciEngine *)g_engine)->getResourceManager(); // HACK + return open(resMan); + } virtual int open(ResourceManager *resMan) { return _driver->open(); } virtual void close() { _driver->close(); } virtual void send(uint32 b) { _driver->send(b); } -- cgit v1.2.3