TITANIC: Renaming methods in CMusicRoomHandler

This commit is contained in:
Paul Gilbert 2017-02-12 13:56:00 -05:00
parent e00fb13809
commit c33962f69d
2 changed files with 19 additions and 7 deletions

View File

@ -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();

View File

@ -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);