cleanup
svn-id: r6847
This commit is contained in:
parent
2c579c25ce
commit
be47bc121e
4 changed files with 17 additions and 21 deletions
|
@ -458,7 +458,7 @@ public:
|
||||||
bool startSound(int sound);
|
bool startSound(int sound);
|
||||||
int stopSound(int sound);
|
int stopSound(int sound);
|
||||||
int stop_all_sounds();
|
int stop_all_sounds();
|
||||||
int get_sound_status(int sound);
|
int getSoundStatus(int sound);
|
||||||
bool get_sound_active(int sound);
|
bool get_sound_active(int sound);
|
||||||
int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
|
int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
|
||||||
int clear_queue();
|
int clear_queue();
|
||||||
|
@ -720,6 +720,7 @@ bool IMuseInternal::startSound(int sound) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
player->clear();
|
player->clear();
|
||||||
|
|
||||||
return player->startSound(sound);
|
return player->startSound(sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1011,7 +1012,7 @@ byte VolumeFader::fading_to() {
|
||||||
return newvol;
|
return newvol;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IMuseInternal::get_sound_status(int sound) {
|
int IMuseInternal::getSoundStatus(int sound) {
|
||||||
int i;
|
int i;
|
||||||
Player *player;
|
Player *player;
|
||||||
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
|
for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
|
||||||
|
@ -1028,7 +1029,7 @@ int IMuseInternal::get_sound_status(int sound) {
|
||||||
return get_queue_sound_status(sound);
|
return get_queue_sound_status(sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is exactly the same as get_sound_status except that
|
// This is exactly the same as getSoundStatus except that
|
||||||
// it treats sounds that are fading out just the same as
|
// it treats sounds that are fading out just the same as
|
||||||
// other sounds. This is the method to use when determining
|
// other sounds. This is the method to use when determining
|
||||||
// what resources to expire from memory.
|
// what resources to expire from memory.
|
||||||
|
@ -1286,7 +1287,7 @@ int32 IMuseInternal::doCommand(int a, int b, int c, int d, int e, int f, int g,
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
case 13:
|
case 13:
|
||||||
return get_sound_status(b);
|
return getSoundStatus(b);
|
||||||
case 14:
|
case 14:
|
||||||
// Sam and Max: Volume Fader?
|
// Sam and Max: Volume Fader?
|
||||||
// Prevent instantaneous volume fades.
|
// Prevent instantaneous volume fades.
|
||||||
|
@ -1490,7 +1491,7 @@ int32 IMuseInternal::ImSetTrigger (int sound, int id, int a, int b, int c, int d
|
||||||
|
|
||||||
// If the command is to start a sound, stop that sound if it's already playing.
|
// If the command is to start a sound, stop that sound if it's already playing.
|
||||||
// This fixes some carnival music problems.
|
// This fixes some carnival music problems.
|
||||||
if (trig->command [0] == 8 && get_sound_status (trig->command [1]))
|
if (trig->command [0] == 8 && getSoundStatus (trig->command [1]))
|
||||||
stopSound (trig->command [1]);
|
stopSound (trig->command [1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3554,7 +3555,7 @@ int IMuse::get_master_volume() { in(); int ret = _target->get_master_volume(); o
|
||||||
bool IMuse::startSound(int sound) { in(); bool ret = _target->startSound (sound); out(); return ret; }
|
bool IMuse::startSound(int sound) { in(); bool ret = _target->startSound (sound); out(); return ret; }
|
||||||
int IMuse::stopSound(int sound) { in(); int ret = _target->stopSound (sound); out(); return ret; }
|
int IMuse::stopSound(int sound) { in(); int ret = _target->stopSound (sound); out(); return ret; }
|
||||||
int IMuse::stop_all_sounds() { in(); int ret = _target->stop_all_sounds(); out(); return ret; }
|
int IMuse::stop_all_sounds() { in(); int ret = _target->stop_all_sounds(); out(); return ret; }
|
||||||
int IMuse::get_sound_status(int sound) { in(); int ret = _target->get_sound_status (sound); out(); return ret; }
|
int IMuse::getSoundStatus(int sound) { in(); int ret = _target->getSoundStatus (sound); out(); return ret; }
|
||||||
bool IMuse::get_sound_active(int sound) { in(); bool ret = _target->get_sound_active (sound); out(); return ret; }
|
bool IMuse::get_sound_active(int sound) { in(); bool ret = _target->get_sound_active (sound); out(); return ret; }
|
||||||
int32 IMuse::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) { in(); int32 ret = _target->doCommand (a,b,c,d,e,f,g,h); out(); return ret; }
|
int32 IMuse::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) { in(); int32 ret = _target->doCommand (a,b,c,d,e,f,g,h); out(); return ret; }
|
||||||
int IMuse::clear_queue() { in(); int ret = _target->clear_queue(); out(); return ret; }
|
int IMuse::clear_queue() { in(); int ret = _target->clear_queue(); out(); return ret; }
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
bool startSound(int sound);
|
bool startSound(int sound);
|
||||||
int stopSound(int sound);
|
int stopSound(int sound);
|
||||||
int stop_all_sounds();
|
int stop_all_sounds();
|
||||||
int get_sound_status(int sound);
|
int getSoundStatus(int sound);
|
||||||
bool get_sound_active(int sound);
|
bool get_sound_active(int sound);
|
||||||
int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
|
int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
|
||||||
int clear_queue();
|
int clear_queue();
|
||||||
|
|
|
@ -454,7 +454,6 @@ static int compareMP3OffsetTable(const void *a, const void *b) {
|
||||||
|
|
||||||
int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
|
int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
|
||||||
int num = 0, i;
|
int num = 0, i;
|
||||||
byte file_byte, file_byte_2;
|
|
||||||
int size;
|
int size;
|
||||||
byte *sound;
|
byte *sound;
|
||||||
|
|
||||||
|
@ -520,15 +519,11 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sfxFile->seek(offset, SEEK_SET);
|
_sfxFile->seek(offset, SEEK_SET);
|
||||||
i = 0;
|
|
||||||
while (num > 0) {
|
assert(num+1 < (int)ARRAYSIZE(_mouthSyncTimes));
|
||||||
_sfxFile->read(&file_byte, sizeof(file_byte));
|
for (i = 0; i < num; i++)
|
||||||
_sfxFile->read(&file_byte_2, sizeof(file_byte_2));
|
_mouthSyncTimes[i] = _sfxFile->readUint16BE();
|
||||||
assert(i < (int)ARRAYSIZE(_mouthSyncTimes));
|
|
||||||
_mouthSyncTimes[i++] = file_byte | (file_byte_2 << 8);
|
|
||||||
num--;
|
|
||||||
}
|
|
||||||
assert(i < (int)ARRAYSIZE(_mouthSyncTimes));
|
|
||||||
_mouthSyncTimes[i] = 0xFFFF;
|
_mouthSyncTimes[i] = 0xFFFF;
|
||||||
_sfxMode |= mode;
|
_sfxMode |= mode;
|
||||||
_curSoundPos = 0;
|
_curSoundPos = 0;
|
||||||
|
@ -552,7 +547,7 @@ bool Sound::isMouthSyncOff(uint pos) {
|
||||||
|
|
||||||
_endOfMouthSync = false;
|
_endOfMouthSync = false;
|
||||||
do {
|
do {
|
||||||
val ^= 1;
|
val = !val;
|
||||||
j = *ms++;
|
j = *ms++;
|
||||||
if (j == 0xFFFF) {
|
if (j == 0xFFFF) {
|
||||||
_endOfMouthSync = true;
|
_endOfMouthSync = true;
|
||||||
|
@ -587,13 +582,13 @@ int Sound::isSoundRunning(int sound) {
|
||||||
return _scumm->_imuseDigital->getSoundStatus(sound);
|
return _scumm->_imuseDigital->getSoundStatus(sound);
|
||||||
|
|
||||||
if (_scumm->_imuse)
|
if (_scumm->_imuse)
|
||||||
return _scumm->_imuse->get_sound_status(sound);
|
return _scumm->_imuse->getSoundStatus(sound);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is exactly the same as isSoundRunning except that it
|
// This is exactly the same as isSoundRunning except that it
|
||||||
// calls IMuse::get_sound_active() instead of IMuse::get_sound_status().
|
// calls IMuse::get_sound_active() instead of IMuse::getSoundStatus().
|
||||||
// This is necessary when determining what resources to
|
// This is necessary when determining what resources to
|
||||||
// expire from memory.
|
// expire from memory.
|
||||||
bool Sound::isSoundActive(int sound) {
|
bool Sound::isSoundActive(int sound) {
|
||||||
|
|
|
@ -163,7 +163,7 @@ void Scumm::CHARSET_1() {
|
||||||
// This hack will force the backup cutoff system to be used instead,
|
// This hack will force the backup cutoff system to be used instead,
|
||||||
// unless the talkChannel is null (eg, this string has no sound attached)
|
// unless the talkChannel is null (eg, this string has no sound attached)
|
||||||
if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_sound->_talkChannel > 0))
|
if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_sound->_talkChannel > 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_sound->_sfxMode == 0)
|
if (_sound->_sfxMode == 0)
|
||||||
stopTalk();
|
stopTalk();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue