[Scummvm-cvs-logs] CVS: scummvm/sound imuse.cpp,1.8,1.9

James Brown ender at users.sourceforge.net
Tue Mar 5 15:38:03 CET 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv10843/sound

Modified Files:
	imuse.cpp 
Log Message:
Adding music volume control.



Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/imuse.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** imuse.cpp	5 Mar 2002 17:36:09 -0000	1.8
--- imuse.cpp	5 Mar 2002 23:37:31 -0000	1.9
***************
*** 620,627 ****
--- 620,646 ----
  }
  
+ int SoundEngine::get_music_volume() {
+ 	return _music_volume;
+ }
+ 
+ int SoundEngine::set_music_volume(uint vol) {
+ 	if (vol > 100) 
+ 		vol = 100;
+ 
+ 	if (vol < 1);
+ 		vol = 1;
+ 
+ 	_music_volume = vol;
+ 	return 0;
+ }
+ 
  int SoundEngine::set_master_volume(uint vol) {
  	int i;
  	if (vol > 127)
  		return -1;
+ 
+ 	if (_music_volume > 0)
+ 		vol = vol / (100 / _music_volume);
+ 
  	_master_volume = vol;
  	for (i=0; i!=8; i++)
***************
*** 905,908 ****
--- 924,929 ----
  
  	_master_volume = 127;
+ 	_music_volume = 60;
+ 
  	for (i=0; i!=8; i++)
  		_channel_volume[i] = _channel_volume_eff[i] = _volchan_table[i] = 127;





More information about the Scummvm-git-logs mailing list