aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-10 07:41:48 +0000
committerFilippos Karapetis2010-06-10 07:41:48 +0000
commitabc5f97608952d4d1f43c736ecd31f23d0aecb8c (patch)
tree0e607292e5febc9058cbab3c1d78574fe23ab069 /engines/sci/sci.cpp
parent9b8e4e8359083ba322c19701579762104b7a6826 (diff)
downloadscummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.tar.gz
scummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.tar.bz2
scummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.zip
Fixed compilation with the old music code
svn-id: r49560
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 08236597b4..537ec4bef0 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -234,10 +234,7 @@ Common::Error SciEngine::run() {
_gamestate->_soundCmd = new SoundCommandParser(_resMan, segMan, _kernel, _audio, soundVersion);
#ifdef USE_OLD_MUSIC_FUNCTIONS
- if (game_init_sound(_gamestate, 0, soundVersion)) {
- warning("Game initialization failed: Error in sound subsystem. Aborting...");
- return Common::kUnknownError;
- }
+ initGameSound(0, soundVersion);
#endif
syncSoundSettings();
@@ -334,7 +331,7 @@ bool SciEngine::initGame() {
#ifdef USE_OLD_MUSIC_FUNCTIONS
if (_gamestate->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)
- game_init_sound(_gamestate, 0, _features->detectDoSoundType());
+ initGameSound(0, _features->detectDoSoundType());
#endif
// Load game language into printLang property of game object
@@ -345,6 +342,18 @@ bool SciEngine::initGame() {
return true;
}
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+
+void SciEngine::initGameSound(int sound_flags, SciVersion soundVersion) {
+ if (getSciVersion() > SCI_VERSION_0_LATE)
+ sound_flags |= SFX_STATE_FLAG_MULTIPLAY;
+
+ _gamestate->sfx_init_flags = sound_flags;
+ _gamestate->_sound.sfx_init(_resMan, sound_flags, soundVersion);
+}
+
+#endif
+
void SciEngine::initStackBaseWithSelector(Selector selector) {
_gamestate->stack_base[0] = make_reg(0, (uint16)selector);
_gamestate->stack_base[1] = NULL_REG;
@@ -392,7 +401,7 @@ void SciEngine::exitGame() {
#ifdef USE_OLD_MUSIC_FUNCTIONS
_gamestate->_sound.sfx_exit();
// Reinit because some other code depends on having a valid state
- game_init_sound(_gamestate, SFX_STATE_FLAG_NOSOUND, _features->detectDoSoundType());
+ initGameSound(SFX_STATE_FLAG_NOSOUND, _features->detectDoSoundType());
#else
_audio->stopAllAudio();
_gamestate->_soundCmd->clearPlayList();