aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2006-04-23 23:00:32 +0000
committerMax Horn2006-04-23 23:00:32 +0000
commite80d24aa22e5e83a86b28454d23241f3574eef1f (patch)
tree58852fa7ad03cfd0d79f21b3cee69a04a3446c60 /engines
parent91831974a86e5964f24c745c45ea3ed75589ac2e (diff)
downloadscummvm-rg350-e80d24aa22e5e83a86b28454d23241f3574eef1f.tar.gz
scummvm-rg350-e80d24aa22e5e83a86b28454d23241f3574eef1f.tar.bz2
scummvm-rg350-e80d24aa22e5e83a86b28454d23241f3574eef1f.zip
Some more cleanup in class Scumm::Sound
svn-id: r22125
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/resource_he.cpp10
-rw-r--r--engines/scumm/he/sound_he.cpp7
-rw-r--r--engines/scumm/he/sound_he.h10
-rw-r--r--engines/scumm/sound.cpp11
-rw-r--r--engines/scumm/sound.h11
5 files changed, 26 insertions, 23 deletions
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 9bf44b214c..103d9b8e32 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -1821,8 +1821,8 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) {
int i;
int chan = -1;
- for (i = 0; i < ARRAYSIZE(_sound->_heChannel); i++) {
- if (_sound->_heChannel[i].sound == snd1id)
+ for (i = 0; i < ARRAYSIZE(((SoundHE *)_sound)->_heChannel); i++) {
+ if (((SoundHE *)_sound)->_heChannel[i].sound == snd1id)
chan = i;
}
@@ -1830,8 +1830,8 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) {
sbng2Ptr = heFindResource(MKID_BE('SBNG'), snd2Ptr);
if (sbng1Ptr != NULL && sbng2Ptr != NULL) {
- if (chan != -1 && _sound->_heChannel[chan].codeOffs > 0) {
- int curOffs = _sound->_heChannel[chan].codeOffs;
+ if (chan != -1 && ((SoundHE *)_sound)->_heChannel[chan].codeOffs > 0) {
+ int curOffs = ((SoundHE *)_sound)->_heChannel[chan].codeOffs;
src = snd1Ptr + curOffs;
dst = sbng1Ptr + 8;
@@ -1850,7 +1850,7 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) {
dst = sbng1Ptr + 8;
}
- _sound->_heChannel[chan].codeOffs = sbng1Ptr - snd1Ptr + 8;
+ ((SoundHE *)_sound)->_heChannel[chan].codeOffs = sbng1Ptr - snd1Ptr + 8;
tmp = sbng2Ptr + 8;
while ((offs = READ_LE_UINT16(tmp)) != 0) {
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index e626d78ef9..af17ed6ac0 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -157,6 +157,13 @@ void SoundHE::stopSound(int sound) {
}
}
+void SoundHE::stopAllSounds() {
+ // Clear sound channels for HE games
+ memset(_heChannel, 0, sizeof(_heChannel));
+
+ Sound::stopAllSounds();
+}
+
void SoundHE::setupSound() {
Sound::setupSound();
diff --git a/engines/scumm/he/sound_he.h b/engines/scumm/he/sound_he.h
index 1beae1ab43..4e3511b2ab 100644
--- a/engines/scumm/he/sound_he.h
+++ b/engines/scumm/he/sound_he.h
@@ -43,6 +43,15 @@ protected:
Audio::SoundHandle _heSoundChannels[8];
+public: // Used by createSound()
+ struct {
+ int sound;
+ int codeOffs;
+ int priority;
+ int sbngBlock;
+ int soundVars[27];
+ } _heChannel[8];
+
public:
SoundHE(ScummEngine *parent);
~SoundHE();
@@ -52,6 +61,7 @@ public:
virtual int isSoundRunning(int sound) const;
virtual void stopSound(int sound);
+ virtual void stopAllSounds();
virtual void setupSound();
bool getHEMusicDetails(int id, int &musicOffs, int &musicSize);
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index e5c669f06d..bdb4e658a1 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -111,14 +111,12 @@ void Sound::addSoundToQueue2(int sound, int heOffset, int heChannel, int heFlags
}
void Sound::processSound() {
- if (_vm->_game.heversion >= 60) {
+ if (_vm->_game.features & GF_DIGI_IMUSE) {
+ processSfxQueues();
+ } else if (_vm->_game.heversion >= 60) {
processSoundQueues();
} else {
processSfxQueues();
-
- if (_vm->_game.features & GF_DIGI_IMUSE)
- return;
-
processSoundQueues();
}
}
@@ -789,9 +787,6 @@ void Sound::stopAllSounds() {
stopCDTimer();
}
- // Clear sound channels for HE games
- memset(_heChannel, 0, sizeof(_heChannel));
-
// Clear the (secondary) sound queue
_soundQue2Pos = 0;
memset(_soundQue2, 0, sizeof(_soundQue2));
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 4966bfb7a3..bf28cc9f3a 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -84,15 +84,6 @@ protected:
int16 _currentCDSound;
int16 _currentMusic;
-public: // Used by createSound()
- struct {
- int sound;
- int codeOffs;
- int priority;
- int sbngBlock;
- int soundVars[27];
- } _heChannel[8];
-
public:
Audio::SoundHandle _talkChannelHandle; // Handle of mixer channel actor is talking on
@@ -113,7 +104,7 @@ public:
virtual int isSoundRunning(int sound) const;
bool isSoundInUse(int sound) const;
virtual void stopSound(int sound);
- void stopAllSounds();
+ virtual void stopAllSounds();
void soundKludge(int *list, int num);
void talkSound(uint32 a, uint32 b, int mode, int channel = 0);
virtual void setupSound();