diff options
author | Paul Gilbert | 2017-02-12 21:39:30 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-12 21:39:30 -0500 |
commit | 8fec9daff2f3de1c0b5971373382a82a2ceb54d3 (patch) | |
tree | 7553b3de4828f4a23b7c74801ad4eb4348c23d7d | |
parent | bb840c9ec205d4c6a94d73c107f520d557983791 (diff) | |
download | scummvm-rg350-8fec9daff2f3de1c0b5971373382a82a2ceb54d3.tar.gz scummvm-rg350-8fec9daff2f3de1c0b5971373382a82a2ceb54d3.tar.bz2 scummvm-rg350-8fec9daff2f3de1c0b5971373382a82a2ceb54d3.zip |
TITANIC: Further CMusicRoomHandler renamings
-rw-r--r-- | engines/titanic/sound/music_room_handler.cpp | 22 | ||||
-rw-r--r-- | engines/titanic/sound/music_room_handler.h | 4 | ||||
-rw-r--r-- | engines/titanic/sound/music_song.cpp | 22 | ||||
-rw-r--r-- | engines/titanic/sound/music_song.h | 4 |
4 files changed, 26 insertions, 26 deletions
diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp index 1373f200e7..fca1fd5460 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 9222a9248d..ec117e3098 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 5894f344af..a5527da356 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 33ad95882c..98bc37fd2b 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 { |