aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorMax Horn2010-02-13 17:42:49 +0000
committerMax Horn2010-02-13 17:42:49 +0000
commitac4d325e0d61b649026a5f5414f749697b285ccc (patch)
treec58f62596d050be62e98180c0255e7998a9a62e4 /engines/sci/sound
parent24fd77eb242c4d90e8c3a3b0bcc5f0c48a4dc77f (diff)
downloadscummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.gz
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.tar.bz2
scummvm-rg350-ac4d325e0d61b649026a5f5414f749697b285ccc.zip
SCI: Add global g_sci pointer to the active SciEngine instance
svn-id: r48046
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/drivers/mididriver.h2
-rw-r--r--engines/sci/sound/iterator/core.cpp2
-rw-r--r--engines/sci/sound/iterator/iterator.cpp2
-rw-r--r--engines/sci/sound/music.cpp6
-rw-r--r--engines/sci/sound/soundcmd.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/engines/sci/sound/drivers/mididriver.h b/engines/sci/sound/drivers/mididriver.h
index ec67f8bb21..22b08e22d6 100644
--- a/engines/sci/sound/drivers/mididriver.h
+++ b/engines/sci/sound/drivers/mididriver.h
@@ -73,7 +73,7 @@ public:
MidiPlayer(SciVersion version) : _reverb(0), _version(version) { }
int open() {
- ResourceManager *resMan = ((SciEngine *)g_engine)->getResourceManager(); // HACK
+ ResourceManager *resMan = g_sci->getResourceManager(); // HACK
return open(resMan);
}
virtual int open(ResourceManager *resMan) { return _driver->open(); }
diff --git a/engines/sci/sound/iterator/core.cpp b/engines/sci/sound/iterator/core.cpp
index c7c9ace028..7e5b690c08 100644
--- a/engines/sci/sound/iterator/core.cpp
+++ b/engines/sci/sound/iterator/core.cpp
@@ -228,7 +228,7 @@ Common::Error SfxPlayer::init(ResourceManager *resMan, int expected_latency) {
switch (musicDriver) {
case MD_ADLIB:
// FIXME: There's no Amiga sound option, so we hook it up to AdLib
- if (((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga)
+ if (g_sci->getPlatform() == Common::kPlatformAmiga)
_mididrv = MidiPlayer_Amiga_create(_soundVersion);
else
_mididrv = MidiPlayer_AdLib_create(_soundVersion);
diff --git a/engines/sci/sound/iterator/iterator.cpp b/engines/sci/sound/iterator/iterator.cpp
index d800b80a36..5d9d63e5af 100644
--- a/engines/sci/sound/iterator/iterator.cpp
+++ b/engines/sci/sound/iterator/iterator.cpp
@@ -144,7 +144,7 @@ void SongIteratorChannel::resetSynthChannels() {
byte buf[5];
// FIXME: Evil hack
- SfxState &sound = ((SciEngine*)g_engine)->getEngineState()->_sound;
+ SfxState &sound = g_sci->getEngineState()->_sound;
for (int i = 0; i < MIDI_CHANNELS; i++) {
if (playmask & (1 << i)) {
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index ed007d0b8a..7915395e9a 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -67,7 +67,7 @@ void SciMusic::init() {
// WORKAROUND: Default to MIDI in Amiga SCI1_EGA+ games as we don't support those patches yet.
// We also don't yet support the 7.pat file of SCI1+ Mac games or SCI0 Mac patches, so we
// default to MIDI in those games to let them run.
- Common::Platform platform = ((SciEngine *)g_engine)->getPlatform();
+ Common::Platform platform = g_sci->getPlatform();
if (getSciVersion() >= SCI_VERSION_2 || platform == Common::kPlatformMacintosh || (platform == Common::kPlatformAmiga && getSciVersion() >= SCI_VERSION_1_EGA))
midiType = MidiDriver::detectMusicDriver(MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MIDI);
@@ -77,7 +77,7 @@ void SciMusic::init() {
switch (midiType) {
case MD_ADLIB:
// FIXME: There's no Amiga sound option, so we hook it up to AdLib
- if (((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga)
+ if (g_sci->getPlatform() == Common::kPlatformAmiga)
_pMidiDrv = MidiPlayer_Amiga_create(_soundVersion);
else
_pMidiDrv = MidiPlayer_AdLib_create(_soundVersion);
@@ -199,7 +199,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
delete pSnd->pStreamAud;
byte flags = Audio::FLAG_UNSIGNED;
// Amiga SCI1 games had signed sound data
- if (_soundVersion >= SCI_VERSION_1_EARLY && ((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga)
+ if (_soundVersion >= SCI_VERSION_1_EARLY && g_sci->getPlatform() == Common::kPlatformAmiga)
flags = 0;
int endPart = track->digitalSampleEnd > 0 ? (track->digitalSampleSize - track->digitalSampleEnd) : 0;
pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart,
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 318adf01c9..70e0ba5b0c 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -133,7 +133,7 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM
#ifdef USE_OLD_MUSIC_FUNCTIONS
// The following hack is needed to ease the change from old to new sound code (because the new sound code does not use SfxState)
- _state = &((SciEngine *)g_engine)->getEngineState()->_sound; // HACK
+ _state = &g_sci->getEngineState()->_sound; // HACK
#endif
#ifndef USE_OLD_MUSIC_FUNCTIONS