mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
Added simon sound bugfix, patch #632518
Added fix for simon sound-related crash, patch #632517 svn-id: r5377
This commit is contained in:
parent
099bf6caba
commit
e03be389de
@ -99,6 +99,9 @@ bool File::open(const char *filename, const char *directory, int mode, byte encb
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filename == NULL || *filename == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
clearIOFailed();
|
clearIOFailed();
|
||||||
|
|
||||||
if (mode == kFileReadMode) {
|
if (mode == kFileReadMode) {
|
||||||
|
@ -143,6 +143,10 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst)
|
|||||||
warning("Sound initialization failed. "
|
warning("Sound initialization failed. "
|
||||||
"Features of the game that depend on sound synchronization will most likely break");
|
"Features of the game that depend on sound synchronization will most likely break");
|
||||||
set_volume(detector->_sfx_volume);
|
set_volume(detector->_sfx_volume);
|
||||||
|
|
||||||
|
_playing_sound = 0;
|
||||||
|
_effects_sound = 0;
|
||||||
|
_voice_sound = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimonState::~SimonState()
|
SimonState::~SimonState()
|
||||||
@ -4770,7 +4774,8 @@ void SimonState::playVoice(uint voice)
|
|||||||
if (_voice_offsets == NULL)
|
if (_voice_offsets == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_mixer->stop(_voice_sound);
|
if (_voice_sound != 0)
|
||||||
|
_mixer->stop(_voice_sound);
|
||||||
_voice_file->seek(_voice_offsets[voice], SEEK_SET);
|
_voice_file->seek(_voice_offsets[voice], SEEK_SET);
|
||||||
|
|
||||||
#ifdef USE_MAD
|
#ifdef USE_MAD
|
||||||
@ -4858,7 +4863,8 @@ void SimonState::playSound(uint sound)
|
|||||||
VocBlockHeader voc_block_hdr;
|
VocBlockHeader voc_block_hdr;
|
||||||
uint32 size;
|
uint32 size;
|
||||||
|
|
||||||
_mixer->stop(_effects_sound);
|
if (_effects_sound != 0)
|
||||||
|
_mixer->stop(_effects_sound);
|
||||||
_effects_file->seek(_effects_offsets[sound], SEEK_SET);
|
_effects_file->seek(_effects_offsets[sound], SEEK_SET);
|
||||||
|
|
||||||
|
|
||||||
@ -4891,7 +4897,8 @@ void SimonState::playSound(uint sound)
|
|||||||
|
|
||||||
byte *p;
|
byte *p;
|
||||||
|
|
||||||
_mixer->stop(_playing_sound);
|
if (_playing_sound != 0)
|
||||||
|
_mixer->stop(_playing_sound);
|
||||||
|
|
||||||
/* Check if _sfx_heap is NULL */
|
/* Check if _sfx_heap is NULL */
|
||||||
if (_sfx_heap == NULL) {
|
if (_sfx_heap == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user