[Scummvm-cvs-logs] SF.net SVN: scummvm: [22125] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 23 16:02:02 CEST 2006


Revision: 22125
Author:   fingolfin
Date:     2006-04-23 16:00:32 -0700 (Sun, 23 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22125&view=rev

Log Message:
-----------
Some more cleanup in class Scumm::Sound

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/resource_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.h
    scummvm/trunk/engines/scumm/sound.cpp
    scummvm/trunk/engines/scumm/sound.h
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-04-23 22:55:55 UTC (rev 22124)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-04-23 23:00:32 UTC (rev 22125)
@@ -1821,8 +1821,8 @@
 
 	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 @@
 	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 @@
 			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) {

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-04-23 22:55:55 UTC (rev 22124)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-04-23 23:00:32 UTC (rev 22125)
@@ -157,6 +157,13 @@
 	}
 }
 
+void SoundHE::stopAllSounds() {
+	// Clear sound channels for HE games
+	memset(_heChannel, 0, sizeof(_heChannel));
+
+	Sound::stopAllSounds();
+}
+
 void SoundHE::setupSound() {
 	Sound::setupSound();
 

Modified: scummvm/trunk/engines/scumm/he/sound_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.h	2006-04-23 22:55:55 UTC (rev 22124)
+++ scummvm/trunk/engines/scumm/he/sound_he.h	2006-04-23 23:00:32 UTC (rev 22125)
@@ -43,6 +43,15 @@
 
 	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 @@
 
 	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);

Modified: scummvm/trunk/engines/scumm/sound.cpp
===================================================================
--- scummvm/trunk/engines/scumm/sound.cpp	2006-04-23 22:55:55 UTC (rev 22124)
+++ scummvm/trunk/engines/scumm/sound.cpp	2006-04-23 23:00:32 UTC (rev 22125)
@@ -111,14 +111,12 @@
 }
 
 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 @@
 		stopCDTimer();
 	}
 
-	// Clear sound channels for HE games
-	memset(_heChannel, 0, sizeof(_heChannel));
-
 	// Clear the (secondary) sound queue
 	_soundQue2Pos = 0;
 	memset(_soundQue2, 0, sizeof(_soundQue2));

Modified: scummvm/trunk/engines/scumm/sound.h
===================================================================
--- scummvm/trunk/engines/scumm/sound.h	2006-04-23 22:55:55 UTC (rev 22124)
+++ scummvm/trunk/engines/scumm/sound.h	2006-04-23 23:00:32 UTC (rev 22125)
@@ -84,15 +84,6 @@
 	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 @@
 	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();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list