diff options
| author | Filippos Karapetis | 2010-06-10 07:41:48 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2010-06-10 07:41:48 +0000 | 
| commit | abc5f97608952d4d1f43c736ecd31f23d0aecb8c (patch) | |
| tree | 0e607292e5febc9058cbab3c1d78574fe23ab069 | |
| parent | 9b8e4e8359083ba322c19701579762104b7a6826 (diff) | |
| download | scummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.tar.gz scummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.tar.bz2 scummvm-rg350-abc5f97608952d4d1f43c736ecd31f23d0aecb8c.zip  | |
Fixed compilation with the old music code
svn-id: r49560
| -rw-r--r-- | engines/sci/sci.cpp | 21 | ||||
| -rw-r--r-- | engines/sci/sci.h | 3 | 
2 files changed, 16 insertions, 8 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(); diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 0bcff8a02e..43e9c88da9 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -253,9 +253,8 @@ private:  	 * @param[in] s				The state to initialize the sound in  	 * @param[in] sound_flags	Flags to pass to the sound subsystem  	 * @param[in] soundVersion	sound-version that got detected during game init -	 * @return					0 on success, 1 if an error occured  	 */ -	int game_init_sound(EngineState *s, int sound_flags, SciVersion soundVersion); +	void initGameSound(int sound_flags, SciVersion soundVersion);  #endif  	void initStackBaseWithSelector(Selector selector);  | 
