LAB: Do not pause the background music when a sound effect is played

This commit is contained in:
Filippos Karapetis 2015-12-27 21:42:51 +02:00
parent 70822b32b0
commit ab8382418d
3 changed files with 0 additions and 33 deletions

View file

@ -418,8 +418,6 @@ void LabEngine::mainGameLoop() {
break;
}
_music->resumeBackMusic();
// Sees what kind of close up we're in and does the appropriate stuff, if any.
if (doCloseUp(_closeDataPtr)) {
_closeDataPtr = nullptr;

View file

@ -45,7 +45,6 @@ namespace Lab {
Music::Music(LabEngine *vm) : _vm(vm) {
_musicFile = nullptr;
_musicPaused = false;
_curRoomMusic = 1;
_storedPos = 0;
}
@ -64,7 +63,6 @@ void Music::changeMusic(const Common::String filename, bool storeCurPos, bool se
if (storeCurPos)
_storedPos = _musicFile->pos();
_musicPaused = false;
stopSoundEffect();
freeMusic();
_musicFile = _vm->_resource->openDataFile(filename);
@ -76,7 +74,6 @@ void Music::changeMusic(const Common::String filename, bool storeCurPos, bool se
}
void Music::playSoundEffect(uint16 sampleSpeed, uint32 length, bool loop, Common::File *dataFile) {
pauseBackMusic();
stopSoundEffect();
// NOTE: We need to use malloc(), cause this will be freed with free()
@ -100,26 +97,9 @@ bool Music::isSoundEffectActive() const {
void Music::freeMusic() {
_vm->_mixer->stopHandle(_musicHandle);
_vm->_mixer->stopHandle(_sfxHandle);
_musicPaused = false;
_musicFile = nullptr;
}
void Music::pauseBackMusic() {
if (!_musicPaused) {
stopSoundEffect();
_vm->_mixer->pauseHandle(_musicHandle, true);
_musicPaused = true;
}
}
void Music::resumeBackMusic() {
if (_musicPaused) {
stopSoundEffect();
_vm->_mixer->pauseHandle(_musicHandle, false);
_musicPaused = false;
}
}
void Music::checkRoomMusic() {
if ((_curRoomMusic == _vm->_roomNum) || !_musicFile)
return;

View file

@ -50,7 +50,6 @@ private:
LabEngine *_vm;
Common::File *_musicFile;
bool _musicPaused;
uint16 _curRoomMusic;
uint32 _storedPos;
@ -58,12 +57,7 @@ private:
Audio::SoundHandle _sfxHandle;
private:
/**
* Pauses the background music.
*/
void pauseBackMusic();
void readSound(bool waitTillFinished, bool loop, Common::File *file);
byte getSoundFlags();
public:
@ -92,11 +86,6 @@ public:
*/
bool loadSoundEffect(const Common::String filename, bool loop, bool waitTillFinished);
/**
* Resumes the paused background music.
*/
void resumeBackMusic();
void stopSoundEffect();
};