diff options
author | Paul Gilbert | 2016-08-07 19:04:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-07 19:04:28 -0400 |
commit | 8b6ac03f18c69a519f1fdcd9bb49920bcfe78012 (patch) | |
tree | 6aa7f58317530b6a16464029e09282a1dd412b38 /engines/titanic/sound/sound.cpp | |
parent | 0b244412e302bf5366327ac3ce4ee265b053a9da (diff) | |
download | scummvm-rg350-8b6ac03f18c69a519f1fdcd9bb49920bcfe78012.tar.gz scummvm-rg350-8b6ac03f18c69a519f1fdcd9bb49920bcfe78012.tar.bz2 scummvm-rg350-8b6ac03f18c69a519f1fdcd9bb49920bcfe78012.zip |
TITANIC: Start of music player class
Diffstat (limited to 'engines/titanic/sound/sound.cpp')
-rw-r--r-- | engines/titanic/sound/sound.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp index 9b894e5eca..d86262ae23 100644 --- a/engines/titanic/sound/sound.cpp +++ b/engines/titanic/sound/sound.cpp @@ -26,11 +26,6 @@ namespace Titanic { -int CSoundItem::fn1() { - // TODO - return 0; -} - CSound::CSound(CGameManager *owner, Audio::Mixer *mixer) : _gameManager(owner), _soundManager(mixer) { g_vm->_movieManager.setSoundManager(&_soundManager); @@ -48,11 +43,22 @@ void CSound::preLoad() { _soundManager.preLoad(); if (_gameManager) - _gameManager->_musicRoom.preLoad(); + _gameManager->_musicRoom.destroyMusicHandler(); } void CSound::preEnterView(CViewItem *newView, bool isNewRoom) { - warning("CSound::preEnterView"); + CNodeItem *node = newView->findNode(); + CRoomItem *room = node->findRoom(); + double xp, yp, zp; + node->getPosition(xp, yp, zp); + + double cosVal = cos(newView->_angle); + double sinVal = -sin(newView->_angle); + + // WORKAROUND: The original does a weird call below, doing the room's + // (width + height) / 2 and passing it in the isNewRoom field, along with + // two extra unused parameters that aren't used + _soundManager.setListenerPosition(xp, yp, zp, cosVal, sinVal, 0, isNewRoom); } bool CSound::isActive(int handle) const { @@ -66,7 +72,7 @@ void CSound::setVolume(uint handle, uint volume, uint seconds) { _soundManager.setVolume(handle, volume, seconds); } -void CSound::fn4(CWaveFile *waveFile, int val) { +void CSound::fn4(CWaveFile *waveFile, int val) { // TODO } |