[Scummvm-git-logs] scummvm master -> e1e93fa9c025bc39cf05fd8cf4a232c846a813da

dreammaster dreammaster at scummvm.org
Fri Feb 3 02:59:43 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e1e93fa9c0 TITANIC: Extra CMusicRoomHandler init & destroy


Commit: e1e93fa9c025bc39cf05fd8cf4a232c846a813da
    https://github.com/scummvm/scummvm/commit/e1e93fa9c025bc39cf05fd8cf4a232c846a813da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-02T20:58:38-05:00

Commit Message:
TITANIC: Extra CMusicRoomHandler init & destroy

Changed paths:
    engines/titanic/sound/music_room_handler.cpp
    engines/titanic/sound/music_room_handler.h


diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp
index 0b9c734..c827e94 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 2240778..869ce98 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;





More information about the Scummvm-git-logs mailing list