svn-id: r8662
This commit is contained in:
Max Horn 2003-06-27 00:10:17 +00:00
parent aa19687a4c
commit c10905b975
6 changed files with 23 additions and 23 deletions

View File

@ -437,7 +437,7 @@ int32 Bundle::getNumberOfMusicSamplesByName(const char *name) {
bitsleft = 16; \
}
int32 Bundle::compDecode(byte *src, byte *dst) {
static int32 compDecode(byte *src, byte *dst) {
byte *result, *srcptr = src, *dstptr = dst;
int data, size, bit, bitsleft = 16, mask = READ_LE_UINT16(srcptr);
srcptr += 2;

View File

@ -56,7 +56,6 @@ private:
void initializeImcTables();
int32 compDecode(byte *src, byte *dst);
int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size);
int32 decompressVoiceSampleByIndex(int32 index, byte **comp_final);

View File

@ -1136,7 +1136,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
debug(5, "Play imuse music: %s, %s, %s", _digStateMusicTable[music].name, _digStateMusicTable[music].title, _digStateMusicTable[music].filename);
if ((_digStateMusicTable[music].filename[0] != 0) &&
(strcmp(_digStateMusicTable[_digStateMusicTable[music].unk3].filename, _scumm->_sound->_nameBundleMusic) != 0) ) {
_scumm->_sound->playBundleMusic((const char *)_digStateMusicTable[music].filename);
_scumm->_sound->playBundleMusic(_digStateMusicTable[music].filename);
}
return 0;
}
@ -1155,7 +1155,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_comiStateMusicTable[l].id == b)) {
debug(5, "Play imuse music: %s, %s, %s", _comiStateMusicTable[l].name, _comiStateMusicTable[l].title, _comiStateMusicTable[l].filename);
if (_comiStateMusicTable[l].filename[0] != 0) {
_scumm->_sound->playBundleMusic((const char *)_comiStateMusicTable[l].filename);
_scumm->_sound->playBundleMusic(_comiStateMusicTable[l].filename);
}
return 0;
}
@ -1189,7 +1189,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_digSeqMusicTable[l].room == b)) {
debug(5, "Play imuse music: %s, %s, %s", _digSeqMusicTable[l].name, _digSeqMusicTable[l].title, _digSeqMusicTable[l].filename);
if (_digSeqMusicTable[l].filename[0] != 0) {
_scumm->_sound->playBundleMusic((const char *)_digSeqMusicTable[l].filename);
_scumm->_sound->playBundleMusic(_digSeqMusicTable[l].filename);
}
return 0;
}
@ -1202,7 +1202,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i
if ((_comiSeqMusicTable[l].id == b)) {
debug(5, "Play imuse music: %s, %s, %s", _comiSeqMusicTable[l].name, _comiSeqMusicTable[l].title, _comiSeqMusicTable[l].filename);
if (_comiSeqMusicTable[l].filename[0] != 0) {
_scumm->_sound->playBundleMusic((const char *)_comiSeqMusicTable[l].filename);
_scumm->_sound->playBundleMusic(_comiSeqMusicTable[l].filename);
}
return 0;
}

View File

@ -327,13 +327,15 @@ static const uint16 pcjr_freq_table[12] = {
////////////////////////////////////////
Player_V2::Player_V2(Scumm *scumm) : _scumm(scumm) {
Player_V2::Player_V2(Scumm *scumm) {
int i;
// This simulates the pc speaker sound, which is driven
// by the 8253 (square wave generator) and a low-band filter.
_isV3Game = (scumm->_version == 3);
_system = scumm->_system;
_mixer = scumm->_mixer;
_sample_rate = _system->property(OSystem::PROP_GET_SAMPLE_RATE, 0);
_mutex = _system->create_mutex();
@ -362,18 +364,18 @@ Player_V2::Player_V2(Scumm *scumm) : _scumm(scumm) {
set_pcjr(true);
set_master_volume(255);
scumm->_mixer->setupPremix(this, premix_proc);
_mixer->setupPremix(this, premix_proc);
}
Player_V2::~Player_V2() {
mutex_up();
// Detach the premix callback handler
_scumm->_mixer->setupPremix (0, 0);
_mixer->setupPremix(0, 0);
mutex_down();
_system->delete_mutex (_mutex);
}
void Player_V2::set_pcjr (bool pcjr) {
void Player_V2::set_pcjr(bool pcjr) {
mutex_up();
_pcjr = pcjr;
@ -526,7 +528,7 @@ void Player_V2::restartSound() {
}
}
int Player_V2::getSoundStatus(int nr) {
bool Player_V2::getSoundStatus(int nr) const {
return current_nr == nr || next_nr == nr;
}
@ -556,8 +558,8 @@ void Player_V2::clear_channel(int i) {
channel->d.freqmod_modulo = 0;
}
int Player_V2::getMusicTimer() {
if (_scumm->_version == 3)
int Player_V2::getMusicTimer() const {
if (_isV3Game)
return _music_timer;
else
return channels[0].d.music_timer;

View File

@ -80,13 +80,13 @@ public:
void startSound(int nr, byte *data);
void stopSound(int nr);
void stopAllSounds();
int getSoundStatus(int nr);
int getMusicTimer();
bool getSoundStatus(int nr) const;
int getMusicTimer() const;
private:
bool _isV3Game;
SoundMixer *_mixer;
Scumm *_scumm;
OSystem *_system;
bool _pcjr;
int _header_len;
@ -116,7 +116,6 @@ private:
byte *next_data;
byte *retaddr;
OSystem *_system;
void *_mutex;
void mutex_up() { _system->lock_mutex (_mutex); }
void mutex_down() { _system->unlock_mutex (_mutex); }

View File

@ -968,7 +968,7 @@ bool Sound::isSfxFinished() const {
uint32 Sound::decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo = false) {
uint32 s_size = (size / 3) * 4;
uint32 loop_size = s_size / 4;
if (stereo == true) {
if (stereo) {
s_size *= 2;
}
byte *ptr = *dst = (byte *)malloc(s_size);
@ -981,14 +981,14 @@ uint32 Sound::decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo
tmp = ((((v2 & 0x0f) << 8) | v1) << 4) - 0x8000;
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
if (stereo == true) {
if (stereo) {
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
}
tmp = ((((v2 & 0xf0) << 4) | v3) << 4) - 0x8000;
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
if (stereo == true) {
if (stereo) {
*ptr++ = (byte)((tmp >> 8) & 0xff);
*ptr++ = (byte)(tmp & 0xff);
}
@ -1001,7 +1001,7 @@ static void music_handler (void *engine) {
}
void Sound::playBundleMusic(const char *song) {
if (_scumm->_silentDigitalImuse == true) {
if (_scumm->_silentDigitalImuse) {
return;
}
@ -1083,7 +1083,7 @@ void Sound::bundleMusicHandler(Scumm *scumm) {
return;
}
if (_musicBundleToBeChanged == true) {
if (_musicBundleToBeChanged) {
_nameBundleMusic = _newNameBundleMusic;
_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(_nameBundleMusic);
_currentSampleBundleMusic = 0;