getting rid of g_mixer; removing lots of whitespace
svn-id: r9527
This commit is contained in:
parent
c431e229b3
commit
75db41750e
10 changed files with 48 additions and 40 deletions
|
@ -554,7 +554,7 @@ class MidiDriver_ADLIB : public MidiDriver {
|
|||
friend class AdlibPercussionChannel;
|
||||
|
||||
public:
|
||||
MidiDriver_ADLIB();
|
||||
MidiDriver_ADLIB(SoundMixer *mixer);
|
||||
|
||||
int open();
|
||||
void close();
|
||||
|
@ -810,14 +810,14 @@ void AdlibPercussionChannel::noteOn(byte note, byte velocity) {
|
|||
|
||||
// MidiDriver method implementations
|
||||
|
||||
MidiDriver_ADLIB::MidiDriver_ADLIB() {
|
||||
MidiDriver_ADLIB::MidiDriver_ADLIB(SoundMixer *mixer)
|
||||
: _mixer(mixer) {
|
||||
uint i;
|
||||
|
||||
_isOpen = false;
|
||||
_game_SmallHeader = false;
|
||||
|
||||
_adlib_reg_cache = 0;
|
||||
_mixer = 0
|
||||
|
||||
_timer_proc = 0;
|
||||
_timer_param = 0;
|
||||
|
@ -839,7 +839,6 @@ int MidiDriver_ADLIB::open() {
|
|||
if (_isOpen)
|
||||
return MERR_ALREADY_OPEN;
|
||||
_isOpen = true;
|
||||
_mixer = g_mixer;
|
||||
|
||||
int i;
|
||||
AdlibVoice *voice;
|
||||
|
|
|
@ -73,7 +73,6 @@ const char *gScummVMFullVersion = "ScummVM 0.5.3cvs (" __DATE__ " " __TIME__ ")"
|
|||
|
||||
/* FIXME - BIG HACK for MidiEmu */
|
||||
OSystem *g_system = 0;
|
||||
SoundMixer *g_mixer = 0;
|
||||
Engine *g_engine = 0;
|
||||
|
||||
Engine::Engine(GameDetector *detector, OSystem *syst)
|
||||
|
@ -83,9 +82,8 @@ Engine::Engine(GameDetector *detector, OSystem *syst)
|
|||
|
||||
_gameDataPath = detector->_gameDataPath;
|
||||
|
||||
/* FIXME - BIG HACK for MidiEmu */
|
||||
g_system = _system;
|
||||
g_mixer = _mixer;
|
||||
g_system = _system; // FIXME - BIG HACK for MidiEmu
|
||||
|
||||
_timer = new Timer(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ struct VersionSettings;
|
|||
|
||||
/* FIXME - BIG HACK for MidiEmu */
|
||||
extern OSystem *g_system;
|
||||
extern SoundMixer *g_mixer;
|
||||
|
||||
class Engine {
|
||||
public:
|
||||
|
|
|
@ -21,15 +21,18 @@
|
|||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "imuse.h"
|
||||
#include "imuse_internal.h"
|
||||
#include "instrument.h"
|
||||
#include "saveload.h"
|
||||
#include "scumm.h"
|
||||
|
||||
#include "common/util.h"
|
||||
#include "sound/mididrv.h"
|
||||
#include "common/gameDetector.h" // For kDefaultMasterVolume etc.
|
||||
|
||||
#include "scumm/imuse.h"
|
||||
#include "scumm/imuse_internal.h"
|
||||
#include "scumm/instrument.h"
|
||||
#include "scumm/saveload.h"
|
||||
#include "scumm/scumm.h"
|
||||
|
||||
#include "sound/mididrv.h"
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
|
@ -78,7 +81,7 @@ MidiDriver *IMuseInternal::getMidiDriver() {
|
|||
} else {
|
||||
// Route it through Adlib anyway.
|
||||
if (!_midi_adlib) {
|
||||
_midi_adlib = MidiDriver_ADLIB_create();
|
||||
_midi_adlib = MidiDriver_ADLIB_create(_mixer);
|
||||
initMidiDriver(_midi_adlib);
|
||||
}
|
||||
driver = _midi_adlib;
|
||||
|
@ -186,14 +189,14 @@ MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
|
|||
} else {
|
||||
// Route it through Adlib anyway.
|
||||
if (!_midi_adlib) {
|
||||
_midi_adlib = MidiDriver_ADLIB_create();
|
||||
_midi_adlib = MidiDriver_ADLIB_create(_mixer);
|
||||
initMidiDriver(_midi_adlib);
|
||||
}
|
||||
driver = _midi_adlib;
|
||||
}
|
||||
} else {
|
||||
if (!_midi_adlib &&(_enable_multi_midi || !_midi_native)) {
|
||||
_midi_adlib = MidiDriver_ADLIB_create();
|
||||
_midi_adlib = MidiDriver_ADLIB_create(_mixer);
|
||||
initMidiDriver(_midi_adlib);
|
||||
}
|
||||
driver = _midi_adlib;
|
||||
|
@ -1048,6 +1051,7 @@ uint32 IMuseInternal::property(int prop, uint32 value) {
|
|||
_players[i].clear();
|
||||
}
|
||||
driver->close();
|
||||
// FIXME: shouldn't we delete 'driver' here, too ?
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1072,15 +1076,16 @@ void IMuseInternal::setBase(byte **base) {
|
|||
_base_sounds = base;
|
||||
}
|
||||
|
||||
IMuseInternal *IMuseInternal::create(OSystem *syst, MidiDriver *native_midi) {
|
||||
IMuseInternal *IMuseInternal::create(OSystem *syst, SoundMixer *mixer, MidiDriver *native_midi) {
|
||||
IMuseInternal *i = new IMuseInternal;
|
||||
i->initialize(syst, native_midi);
|
||||
i->initialize(syst, mixer, native_midi);
|
||||
return i;
|
||||
}
|
||||
|
||||
int IMuseInternal::initialize(OSystem *syst, MidiDriver *native_midi) {
|
||||
int IMuseInternal::initialize(OSystem *syst, SoundMixer *mixer, MidiDriver *native_midi) {
|
||||
int i;
|
||||
|
||||
_mixer = mixer;
|
||||
_midi_native = native_midi;
|
||||
_midi_adlib = NULL;
|
||||
if (native_midi)
|
||||
|
@ -1736,7 +1741,7 @@ MidiDriver *IMuse::getMidiDriver() { in(); MidiDriver *ret = _target->getMidiDri
|
|||
// The IMuse::create method provides a front-end factory
|
||||
// for creating IMuseInternal without exposing that class
|
||||
// to the client.
|
||||
IMuse *IMuse::create(OSystem *syst, MidiDriver *midi) {
|
||||
IMuseInternal *engine = IMuseInternal::create(syst, midi);
|
||||
IMuse *IMuse::create(OSystem *syst, SoundMixer *mixer, MidiDriver *midi) {
|
||||
IMuseInternal *engine = IMuseInternal::create(syst, mixer, midi);
|
||||
return new IMuse(syst, engine);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
MidiDriver *getMidiDriver();
|
||||
|
||||
// Factory methods
|
||||
static IMuse *create(OSystem *syst, MidiDriver *midi);
|
||||
static IMuse *create(OSystem *syst, SoundMixer *mixer, MidiDriver *midi);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#ifndef DEFINED_IMUSE_INTERNAL
|
||||
#define DEFINED_IMUSE_INTERNAL
|
||||
|
||||
#include "sound/mididrv.h"
|
||||
#include "common/scummsys.h"
|
||||
#include "scumm/instrument.h"
|
||||
#include "sound/mididrv.h"
|
||||
|
||||
// Unremark this statement to activate some of
|
||||
// the most common iMuse diagnostic messages.
|
||||
|
@ -45,6 +45,7 @@ class IMuseInternal;
|
|||
class MidiParser;
|
||||
class Scumm;
|
||||
class OSystem;
|
||||
class SoundMixer;
|
||||
|
||||
|
||||
|
||||
|
@ -356,6 +357,8 @@ private:
|
|||
|
||||
byte **_base_sounds;
|
||||
|
||||
SoundMixer *_mixer;
|
||||
|
||||
private:
|
||||
bool _paused;
|
||||
bool _initialized;
|
||||
|
@ -439,7 +442,7 @@ public:
|
|||
IMuseInternal();
|
||||
~IMuseInternal();
|
||||
|
||||
int initialize(OSystem *syst, MidiDriver *midi);
|
||||
int initialize(OSystem *syst, SoundMixer *mixer, MidiDriver *midi);
|
||||
void reallocateMidiChannels(MidiDriver *midi);
|
||||
void setGlobalAdlibInstrument(byte slot, byte *data);
|
||||
void copyGlobalAdlibInstrument(byte slot, Instrument *dest);
|
||||
|
@ -465,7 +468,7 @@ public:
|
|||
uint32 property(int prop, uint32 value);
|
||||
MidiDriver *getMidiDriver();
|
||||
|
||||
static IMuseInternal *create(OSystem *syst, MidiDriver *midi);
|
||||
static IMuseInternal *create(OSystem *syst, SoundMixer *mixer, MidiDriver *midi);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,12 +20,15 @@
|
|||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "scumm/scumm.h"
|
||||
#include "sound/midiparser.h"
|
||||
#include "scumm/saveload.h"
|
||||
|
||||
#include "common/util.h"
|
||||
#include "common/engine.h"
|
||||
#include "imuse_internal.h"
|
||||
|
||||
#include "scumm/imuse_internal.h"
|
||||
#include "scumm/saveload.h"
|
||||
#include "scumm/scumm.h"
|
||||
|
||||
#include "sound/midiparser.h"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -625,16 +625,16 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
|
|||
else
|
||||
_playerV2 = new Player_V2(this);
|
||||
} else {
|
||||
_imuse = IMuse::create (syst, detector->createMidi());
|
||||
_imuse = IMuse::create (syst, _mixer, detector->createMidi());
|
||||
if (_imuse) {
|
||||
if (detector->_gameTempo != 0)
|
||||
_imuse->property(IMuse::PROP_TEMPO_BASE, detector->_gameTempo);
|
||||
_imuse->property (IMuse::PROP_OLD_ADLIB_INSTRUMENTS, (_features & GF_SMALL_HEADER) ? 1 : 0);
|
||||
_imuse->property (IMuse::PROP_MULTI_MIDI, detector->_multi_midi);
|
||||
_imuse->property (IMuse::PROP_NATIVE_MT32, detector->_native_mt32);
|
||||
_imuse->property(IMuse::PROP_OLD_ADLIB_INSTRUMENTS, (_features & GF_SMALL_HEADER) ? 1 : 0);
|
||||
_imuse->property(IMuse::PROP_MULTI_MIDI, detector->_multi_midi);
|
||||
_imuse->property(IMuse::PROP_NATIVE_MT32, detector->_native_mt32);
|
||||
if (_features & GF_HUMONGOUS) {
|
||||
_imuse->property (IMuse::PROP_LIMIT_PLAYERS, 1);
|
||||
_imuse->property (IMuse::PROP_RECYCLE_PLAYERS, 1);
|
||||
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
|
||||
_imuse->property(IMuse::PROP_RECYCLE_PLAYERS, 1);
|
||||
}
|
||||
_imuse->set_music_volume(_sound->_sound_volume_music);
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
|
|||
|
||||
// Setup midi driver
|
||||
if (!driver)
|
||||
driver = MidiDriver_ADLIB_create();
|
||||
driver = MidiDriver_ADLIB_create(_mixer);
|
||||
|
||||
midi.mapMT32toGM (!(_game & GF_SIMON2) && !detector->_native_mt32);
|
||||
midi.set_driver(driver);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "common/scummsys.h"
|
||||
|
||||
class MidiChannel;
|
||||
class SoundMixer;
|
||||
|
||||
// Abstract MIDI Driver Class
|
||||
class MidiDriver {
|
||||
|
@ -132,7 +133,7 @@ enum {
|
|||
|
||||
// Factory functions, for faster compile
|
||||
extern MidiDriver *MidiDriver_NULL_create();
|
||||
extern MidiDriver *MidiDriver_ADLIB_create();
|
||||
extern MidiDriver *MidiDriver_ADLIB_create(SoundMixer *mixer);
|
||||
extern MidiDriver *MidiDriver_WIN_create();
|
||||
extern MidiDriver *MidiDriver_SEQ_create();
|
||||
extern MidiDriver *MidiDriver_QT_create();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue