[Scummvm-cvs-logs] CVS: scummvm/sky sky.cpp,1.100.2.4,1.100.2.5 sound.cpp,1.30,1.30.2.1 sound.h,1.14,1.14.2.1

Robert G?ffringmann lavosspawn at users.sourceforge.net
Wed Aug 6 00:23:17 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv25608/sky

Modified Files:
      Tag: branch-0-5-0
	sky.cpp sound.cpp sound.h 
Log Message:
get sfx volume from command line

Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.100.2.4
retrieving revision 1.100.2.5
diff -u -d -r1.100.2.4 -r1.100.2.5
--- sky.cpp	6 Aug 2003 07:00:37 -0000	1.100.2.4
+++ sky.cpp	6 Aug 2003 07:10:09 -0000	1.100.2.5
@@ -275,7 +275,7 @@
 	OSystem::Property prop;
 
 	_skyDisk = new SkyDisk(_gameDataPath);
-	_skySound = new SkySound(_mixer, _skyDisk);
+	_skySound = new SkySound(_mixer, _skyDisk, _detector->_sfx_volume);
 	
 	_systemVars.gameVersion = _skyDisk->determineGameVersion();
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sound.cpp,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -u -d -r1.30 -r1.30.2.1
--- sound.cpp	23 Jul 2003 19:33:34 -0000	1.30
+++ sound.cpp	6 Aug 2003 07:10:09 -0000	1.30.2.1
@@ -1012,7 +1012,7 @@
 	{ 0, 0, 0, 0}
 };
 
-SkySound::SkySound(SoundMixer *mixer, SkyDisk *pDisk) {
+SkySound::SkySound(SoundMixer *mixer, SkyDisk *pDisk, uint8 pVolume) {
 	_skyDisk = pDisk;
 	_soundData = NULL;
 	_mixer = mixer;
@@ -1022,6 +1022,7 @@
 	_ingameSpeech = 0;
 	_ingameSound0 = _ingameSound1 = 0;
 	_saveSounds[0] = _saveSounds[1] = 0xFFFF;
+	_mainSfxVolume = pVolume;
 }
 
 SkySound::~SkySound(void) {
@@ -1104,7 +1105,7 @@
 		return ;
 	}
 
-	volume = ((volume & 0x7F) + 1) << 1;
+	volume = (volume & 0x7F) << 1;
 	sound &= 0xFF;
 	
 	// note: all those tables are big endian. Don't ask me why. *sigh*
@@ -1162,6 +1163,7 @@
 			volume = roomList[i].adlibVolume;
 		if (SkyState::_systemVars.systemFlags & SF_ROLAND)
 		 	volume = roomList[i].rolandVolume;
+		volume = (volume * _mainSfxVolume) >> 8;
 	}
 
 	// Check the flags, the sound may come on after a delay.

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sound.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- sound.h	23 Jul 2003 19:33:34 -0000	1.14
+++ sound.h	6 Aug 2003 07:10:09 -0000	1.14.2.1
@@ -58,7 +58,7 @@
 	int playSound(uint32 id, byte *sound, uint32 size, PlayingSoundHandle *handle);
 
 public:
-	SkySound(SoundMixer *mixer, SkyDisk *pDisk);
+	SkySound(SoundMixer *mixer, SkyDisk *pDisk, uint8 pVolume);
 	~SkySound(void);
 	int playVoice(byte *sound, uint32 size);
 	int playBgSound(byte *sound, uint32 size);
@@ -81,6 +81,7 @@
 	uint16 _sfxBaseOfs;
 	uint8 *_soundData;
 	uint8 *_sampleRates, *_sfxInfo;
+	uint8 _mainSfxVolume;
 
 	static uint16 _speechConvertTable[8];
 	static SfxQueue _sfxQueue[MAX_QUEUED_FX];





More information about the Scummvm-git-logs mailing list