aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Bacca2002-04-21 21:58:21 +0000
committerNicolas Bacca2002-04-21 21:58:21 +0000
commitd9ce5c659cf9cb30b5fe0d1e65219d0b0d763080 (patch)
treec1e46db51a4aa680b4f5ff9e0b77863aa244a998
parent635cb77d5acf8cc3a519ad07c5c02c57b804299e (diff)
downloadscummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.tar.gz
scummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.tar.bz2
scummvm-rg350-d9ce5c659cf9cb30b5fe0d1e65219d0b0d763080.zip
Pause SFX, pre-initialized volume
svn-id: r4045
-rw-r--r--scumm.h5
-rw-r--r--sound.cpp25
2 files changed, 24 insertions, 6 deletions
diff --git a/scumm.h b/scumm.h
index 50435d194d..8c522c8708 100644
--- a/scumm.h
+++ b/scumm.h
@@ -44,7 +44,11 @@ extern Scumm *g_scumm;
/* System Wide Constants */
enum {
+#ifdef _WIN32_WCE
+ SAMPLES_PER_SEC = 11025,
+#else
SAMPLES_PER_SEC = 22050,
+#endif
BITS_PER_SAMPLE = 16,
NUM_MIXER = 4,
NUM_SCRIPT_SLOT = 25,
@@ -987,6 +991,7 @@ public:
int16 _soundQuePos, _soundQue[0x100];
byte _soundQue2Pos, _soundQue2[10];
bool _soundsPaused, _soundsPaused2;
+ bool _soundVolumePreset;
void setupSound();
void processSoundQues();
diff --git a/sound.cpp b/sound.cpp
index 54d3851d04..3a1dc40a42 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -378,12 +378,19 @@ void Scumm::setupSound()
IMuse *se = _imuse;
if (se) {
se->setBase(res.address[rtSound]);
- if (se->get_music_volume() == 0)
- se->set_music_volume(60);
- se->set_master_volume(125);
+ if (!_soundVolumePreset) {
+ if (se->get_music_volume() == 0)
+ se->set_music_volume(60);
+ se->set_master_volume(125);
+ _sound_volume_music = se->get_music_volume();
+ //_sound_volume_master = (se->get_master_volume() / 127);
+ _sound_volume_master = se->get_master_volume();
- _sound_volume_music = se->get_music_volume();
- _sound_volume_master = (se->get_master_volume() / 127);
+ }
+ else {
+ se->set_music_volume(_sound_volume_music);
+ se->set_master_volume(_sound_volume_master);
+ }
}
_sfxFile = openSfxFile();
}
@@ -579,6 +586,8 @@ void Scumm::playBundleSound(char *sound)
void Scumm::playSfxSound(void *sound, uint32 size, uint rate)
{
+ if (_soundsPaused)
+ return;
_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE);
}
@@ -586,7 +595,8 @@ void Scumm::playSfxSound_MP3(void *sound, uint32 size)
{
#ifdef COMPRESSED_SOUND_FILE
-
+ if (_soundsPaused)
+ return;
_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
#endif
@@ -691,6 +701,9 @@ void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
float frame_size;
mad_timer_t duration;
+ if (_soundsPaused)
+ return;
+
if (!start && !delay) {
_mixer->stop(_mp3_handle);
return;