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

dreammaster dreammaster at scummvm.org
Sun Feb 12 19:56:24 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:
c33962f69d TITANIC: Renaming methods in CMusicRoomHandler


Commit: c33962f69d6e112cde337c85a2b947f86d3fbd1d
    https://github.com/scummvm/scummvm/commit/c33962f69d6e112cde337c85a2b947f86d3fbd1d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-12T13:56:00-05:00

Commit Message:
TITANIC: Renaming methods in CMusicRoomHandler

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 81ba196..b5adbae 100644
--- a/engines/titanic/sound/music_room_handler.cpp
+++ b/engines/titanic/sound/music_room_handler.cpp
@@ -195,7 +195,7 @@ bool CMusicRoomHandler::update() {
 	}
 
 	updateAudio();
-	fn1();
+	updateInstruments();
 
 	return _field108 > 0;
 }
@@ -223,7 +223,7 @@ void CMusicRoomHandler::updateAudio() {
 				if (amount > 0) {
 					count -= amount;
 					ptr += amount / sizeof(uint16);
-				} else if (!updateInstrument(instrument)) {
+				} else if (!pollInstrument(instrument)) {
 					--_field108;
 					break;
 				}
@@ -237,7 +237,7 @@ void CMusicRoomHandler::updateAudio() {
 	_audioBuffer->leaveCriticalSection();
 }
 
-void CMusicRoomHandler::fn1() {
+void CMusicRoomHandler::updateInstruments() {
 	if (_active && _soundStartTicks) {
 		for (MusicInstrument instrument = BELLS; instrument <= BASS;
 				instrument = (MusicInstrument)((int)instrument + 1)) {
@@ -273,7 +273,7 @@ void CMusicRoomHandler::fn1() {
 	}
 }
 
-bool CMusicRoomHandler::updateInstrument(MusicInstrument instrument) {
+bool CMusicRoomHandler::pollInstrument(MusicInstrument instrument) {
 	int &arrIndex = _startPos[instrument];
 	if (arrIndex < 0) {
 		_instruments[instrument]->clear();
diff --git a/engines/titanic/sound/music_room_handler.h b/engines/titanic/sound/music_room_handler.h
index eb274aa..34d2b95 100644
--- a/engines/titanic/sound/music_room_handler.h
+++ b/engines/titanic/sound/music_room_handler.h
@@ -72,17 +72,29 @@ private:
 	 */
 	void start();
 
+	/**
+	 * Handles updating the raw audio being played for all the instruments
+	 */
 	void updateAudio();
-	void fn1();
 
 	/**
-	 * Updates the state of the instrument.
+	 * Handles updating the instruments themselves, and keeping them animating
+	 */
+	void updateInstruments();
+
+	/**
+	 * Polls a specified instrument for any updates to see if it's still active.
 	 * @returns Returns true if a given instrument is still active..
 	 * that is, that there is still more data that can be read from it to play
 	 */
-	bool updateInstrument(MusicInstrument instrument);
+	bool pollInstrument(MusicInstrument instrument);
 
 	double fn3(MusicInstrument instrument, int arrIndex);
+
+	/**
+	 * Figures out a pitch value (of some sort) for use in determining
+	 * which wave file the music instruments will use.
+	 */
 	int getPitch(MusicInstrument instrument, int arrIndex);
 public:
 	CMusicRoomHandler(CProjectItem *project, CSoundManager *soundManager);





More information about the Scummvm-git-logs mailing list