diff options
author | Paul Gilbert | 2016-08-03 21:47:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-03 21:47:11 -0400 |
commit | 3fda4f0ef5ec56caad0332e473993f5628ca6e42 (patch) | |
tree | f5b279f67335fb0b4cf71a26c70059b6f9138027 /engines/titanic/core | |
parent | 9f316a5b37c2065c960dca88953c988d923d748f (diff) | |
download | scummvm-rg350-3fda4f0ef5ec56caad0332e473993f5628ca6e42.tar.gz scummvm-rg350-3fda4f0ef5ec56caad0332e473993f5628ca6e42.tar.bz2 scummvm-rg350-3fda4f0ef5ec56caad0332e473993f5628ca6e42.zip |
TITANIC: Add CSound sound loading methods
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index c04f2e17f4..30366398c1 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -644,7 +644,17 @@ int CGameObject::playSound(const CString &name, int val2, int val3, int val4) { int CGameObject::playSound(const CString &name, CProximity &prox) { if (prox._field28 == 2) { - // TODO + // If the proximity doesn't have a position defined, default it to + // the position of the view to which the game object belongs + if (prox._posX == 0.0 && prox._posY == 0.0 && prox._posZ == 0.0) + findView()->getPosition(prox._posX, prox._posY, prox._posZ); + } + + CGameManager *gameManager = getGameManager(); + if (gameManager) { + g_vm->_filesManager->preload(name); + + gameManager->_sound.playSound(name, prox); } return 0; diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index abb7e999d6..ec7f77cff6 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -26,7 +26,7 @@ #include "titanic/support/mouse_cursor.h" #include "titanic/support/credit_text.h" #include "titanic/support/movie_range_info.h" -#include "titanic/support/proximity.h" +#include "titanic/sound/proximity.h" #include "titanic/support/rect.h" #include "titanic/support/movie_clip.h" #include "titanic/core/named_item.h" |