[Scummvm-git-logs] scummvm master -> 8fec9daff2f3de1c0b5971373382a82a2ceb54d3

dreammaster dreammaster at scummvm.org
Mon Feb 13 03:39:38 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:
8fec9daff2 TITANIC: Further CMusicRoomHandler renamings


Commit: 8fec9daff2f3de1c0b5971373382a82a2ceb54d3
    https://github.com/scummvm/scummvm/commit/8fec9daff2f3de1c0b5971373382a82a2ceb54d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-12T21:39:30-05:00

Commit Message:
TITANIC: Further CMusicRoomHandler renamings

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


diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp
index 1373f20..fca1fd5 100644
--- a/engines/titanic/sound/music_room_handler.cpp
+++ b/engines/titanic/sound/music_room_handler.cpp
@@ -30,8 +30,8 @@ namespace Titanic {
 CMusicRoomHandler::CMusicRoomHandler(CProjectItem *project, CSoundManager *soundManager) :
 		_project(project), _soundManager(soundManager), _active(false),
 		_soundHandle(-1), _waveFile(nullptr), _volume(100) {
-	_field108 = 0;
-	_field118 = 0;
+	_instrumentsActive = 0;
+	_isPlaying = false;
 	_startTicks = _soundStartTicks = 0;
 	Common::fill(&_instruments[0], &_instruments[4], (CMusicRoomInstrument *)nullptr);
 	for (int idx = 0; idx < 4; ++idx)
@@ -91,8 +91,8 @@ void CMusicRoomHandler::setup(int volume) {
 		_animTime[idx] = 0.0;
 	}
 
-	_field108 = 4;
-	_field118 = 1;
+	_instrumentsActive = 4;
+	_isPlaying = true;
 	update();
 
 	_waveFile = _soundManager->loadMusic(_audioBuffer, DisposeAfterUse::NO);
@@ -113,8 +113,8 @@ void CMusicRoomHandler::stop() {
 			_instruments[idx]->stop();
 	}
 
-	_field108 = 0;
-	_field118 = 0;
+	_instrumentsActive = 0;
+	_isPlaying = false;
 	_startTicks = _soundStartTicks = 0;
 }
 
@@ -197,7 +197,7 @@ bool CMusicRoomHandler::update() {
 	updateAudio();
 	updateInstruments();
 
-	return _field108 > 0;
+	return _instrumentsActive > 0;
 }
 
 void CMusicRoomHandler::updateAudio() {
@@ -224,7 +224,7 @@ void CMusicRoomHandler::updateAudio() {
 					count -= amount;
 					ptr += amount / sizeof(uint16);
 				} else if (!pollInstrument(instrument)) {
-					--_field108;
+					--_instrumentsActive;
 					break;
 				}
 			}
@@ -258,7 +258,7 @@ void CMusicRoomHandler::updateInstruments() {
 				_animTime[instrument] += getAnimDuration(instrument, _position[instrument]);
 
 				const CValuePair &vp = (*_songs[instrument])[_position[instrument]];
-				if (vp._field0 != 0x7FFFFFFF) {
+				if (vp._data != 0x7FFFFFFF) {
 					int amount = getPitch(instrument, _position[instrument]);
 					_instruments[instrument]->update(amount);
 				}
@@ -290,7 +290,7 @@ bool CMusicRoomHandler::pollInstrument(MusicInstrument instrument) {
 	const CValuePair &vp = song[arrIndex];
 	uint duration = static_cast<int>(getAnimDuration(instrument, arrIndex) * 44100.0) & ~1;
 
-	if (vp._field0 == 0x7FFFFFFF || _array1[instrument]._muteControl)
+	if (vp._data == 0x7FFFFFFF || _array1[instrument]._muteControl)
 		_instruments[instrument]->reset(duration);
 	else
 		_instruments[instrument]->chooseWaveFile(getPitch(instrument, arrIndex), duration);
@@ -328,7 +328,7 @@ double CMusicRoomHandler::getAnimDuration(MusicInstrument instrument, int arrInd
 int CMusicRoomHandler::getPitch(MusicInstrument instrument, int arrIndex) {
 	const CMusicSong &song = *_songs[instrument];
 	const CValuePair &vp = song[arrIndex];
-	int val = vp._field0;
+	int val = vp._data;
 	const MusicRoomInstrument &ins1 = _array1[instrument];
 	const MusicRoomInstrument &ins2 = _array2[instrument];
 
diff --git a/engines/titanic/sound/music_room_handler.h b/engines/titanic/sound/music_room_handler.h
index 9222a92..ec117e3 100644
--- a/engines/titanic/sound/music_room_handler.h
+++ b/engines/titanic/sound/music_room_handler.h
@@ -60,9 +60,9 @@ private:
 	bool _active;
 	CWaveFile *_waveFile;
 	int _soundHandle;
-	int _field108;
+	int _instrumentsActive;
 	CAudioBuffer *_audioBuffer;
-	int _field118;
+	bool _isPlaying;
 	uint _soundStartTicks;
 	uint _startTicks;
 	int _volume;
diff --git a/engines/titanic/sound/music_song.cpp b/engines/titanic/sound/music_song.cpp
index 5894f34..a5527da 100644
--- a/engines/titanic/sound/music_song.cpp
+++ b/engines/titanic/sound/music_song.cpp
@@ -56,11 +56,11 @@ CMusicSong::CMusicSong(int index) {
 
 	for (int idx = 0; idx < count; ++idx) {
 		CValuePair &vp = _data[idx];
-		if (vp._field0 != 0x7FFFFFFF) {
-			if (vp._field0 < _minVal)
-				_minVal = vp._field0;
-			if (vp._field0 > maxVal)
-				maxVal = vp._field0;
+		if (vp._data != 0x7FFFFFFF) {
+			if (vp._data < _minVal)
+				_minVal = vp._data;
+			if (vp._data > maxVal)
+				maxVal = vp._data;
 		}
 	}
 
@@ -128,7 +128,7 @@ bool CSongParser::parse(CValuePair &r) {
 				break;
 			
 			_flag = true;
-			r._field0 = 0x7FFFFFFF;
+			r._data = 0x7FFFFFFF;
 			r._length = _field10;
 			_field14 = 0;
 			_field1C += _field10;
@@ -145,17 +145,17 @@ bool CSongParser::parse(CValuePair &r) {
 			bool flag = true;
 
 			if (_currentChar == _priorChar) {
-				r._field0 = _field8;
+				r._data = _field8;
 			} else if (_currentChar >= 'a' && _currentChar <= 'g') {
 				val1 -= val2;
 				if (val1 >= 0)
 					val1 -= 12;
-				r._field0 = _field8 + val1;
+				r._data = _field8 + val1;
 			} else if (_currentChar >= 'A' && _currentChar <= 'G') {
 				val1 -= val2;
 				if (val1 <= 0)
 					val1 += 12;
-				r._field0 = _field8 + val1;
+				r._data = _field8 + val1;
 			} else {
 				flag = false;
 			}
@@ -163,9 +163,9 @@ bool CSongParser::parse(CValuePair &r) {
 			if (flag) {
 				r._length = _field10;
 				_field1C += _field10;
-				_field8 = r._field0;
+				_field8 = r._data;
 				_priorChar = _currentChar;
-				r._field0 += _field14;
+				r._data += _field14;
 				_field14 = 0;
 				_flag = true;
 			}
diff --git a/engines/titanic/sound/music_song.h b/engines/titanic/sound/music_song.h
index 33ad958..98bc37f 100644
--- a/engines/titanic/sound/music_song.h
+++ b/engines/titanic/sound/music_song.h
@@ -29,9 +29,9 @@
 namespace Titanic {
 
 struct CValuePair {
-	int _field0;
+	int _data;
 	int _length;
-	CValuePair() : _field0(0), _length(0) {}
+	CValuePair() : _data(0), _length(0) {}
 };
 
 class CMusicSong {





More information about the Scummvm-git-logs mailing list