diff options
author | Paul Gilbert | 2017-02-02 20:58:38 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-02 20:58:38 -0500 |
commit | e1e93fa9c025bc39cf05fd8cf4a232c846a813da (patch) | |
tree | 7cdd7c2bc52b47fe9766a9493ea91c6fa99d47b6 | |
parent | 7b7a0fa3ad805a4a1a6be04eacbad7957d78680f (diff) | |
download | scummvm-rg350-e1e93fa9c025bc39cf05fd8cf4a232c846a813da.tar.gz scummvm-rg350-e1e93fa9c025bc39cf05fd8cf4a232c846a813da.tar.bz2 scummvm-rg350-e1e93fa9c025bc39cf05fd8cf4a232c846a813da.zip |
TITANIC: Extra CMusicRoomHandler init & destroy
-rw-r--r-- | engines/titanic/sound/music_room_handler.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/sound/music_room_handler.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp index 0b9c734859..c827e94955 100644 --- a/engines/titanic/sound/music_room_handler.cpp +++ b/engines/titanic/sound/music_room_handler.cpp @@ -30,17 +30,24 @@ namespace Titanic { CMusicRoomHandler::CMusicRoomHandler(CProjectItem *project, CSoundManager *soundManager) : _project(project), _soundManager(soundManager), _active(false), _soundHandle(-1), _waveFile(nullptr), _volume(100) { - Common::fill(&_musicWaves[0], &_musicWaves[4], (CMusicWave *)nullptr); _field108 = 0; _field118 = 0; _startTicks = _soundStartTicks = 0; + Common::fill(&_musicWaves[0], &_musicWaves[4], (CMusicWave *)nullptr); + for (int idx = 0; idx < 4; ++idx) + _array3[idx] = new Object3(); + Common::fill(&_array4[0], &_array4[4], 0); + Common::fill(&_array6[0], &_array6[4], 0); + _audioBuffer = new CAudioBuffer(176400); } CMusicRoomHandler::~CMusicRoomHandler() { stop(); for (int idx = 0; idx < 4; ++idx) - delete _musicWaves[idx]; + delete _array3[idx]; + + delete _audioBuffer; } CMusicWave *CMusicRoomHandler::createMusicWave(MusicInstrument instrument, int count) { diff --git a/engines/titanic/sound/music_room_handler.h b/engines/titanic/sound/music_room_handler.h index 2240778c2a..869ce98bb1 100644 --- a/engines/titanic/sound/music_room_handler.h +++ b/engines/titanic/sound/music_room_handler.h @@ -64,8 +64,10 @@ private: MusicRoomInstrument _array1[4]; MusicRoomInstrument _array2[4]; Object3 *_array3[4]; + int _array4[4]; Array5Entry _array5[4]; int _array6[4]; + bool _active; CWaveFile *_waveFile; int _soundHandle; |