[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.51,1.52 scumm.h,1.133,1.134

Nicolas Bacca arisme at users.sourceforge.net
Sun Apr 21 14:59:02 CEST 2002


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

Modified Files:
	sound.cpp scumm.h 
Log Message:
Pause SFX, pre-initialized volume

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** sound.cpp	20 Apr 2002 17:41:42 -0000	1.51
--- sound.cpp	21 Apr 2002 21:58:18 -0000	1.52
***************
*** 379,388 ****
  	if (se) {
  		se->setBase(res.address[rtSound]);
! 		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);
  	}
  	_sfxFile = openSfxFile();
--- 379,395 ----
  	if (se) {
  		se->setBase(res.address[rtSound]);
! 		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();
  
! 		}
! 		else {
! 			se->set_music_volume(_sound_volume_music);
! 			se->set_master_volume(_sound_volume_master);
! 		}
  	}
  	_sfxFile = openSfxFile();
***************
*** 580,583 ****
--- 587,592 ----
  void Scumm::playSfxSound(void *sound, uint32 size, uint rate)
  {
+ 	if (_soundsPaused)
+ 		return;
  	_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE);
  }
***************
*** 587,591 ****
  
  #ifdef COMPRESSED_SOUND_FILE
! 
  	_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
  
--- 596,601 ----
  
  #ifdef COMPRESSED_SOUND_FILE
! 	if (_soundsPaused)
! 		return;
  	_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
  
***************
*** 691,694 ****
--- 701,707 ----
  	float frame_size;
  	mad_timer_t duration;
+ 
+ 	if (_soundsPaused)
+ 		return;
  
  	if (!start && !delay) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.133
retrieving revision 1.134
diff -C2 -d -r1.133 -r1.134
*** scumm.h	21 Apr 2002 21:20:32 -0000	1.133
--- scumm.h	21 Apr 2002 21:58:21 -0000	1.134
***************
*** 45,49 ****
--- 45,53 ----
  /* System Wide Constants */
  enum {
+ #ifdef _WIN32_WCE
+ 	SAMPLES_PER_SEC =  11025,
+ #else
  	SAMPLES_PER_SEC =  22050,
+ #endif
  	BITS_PER_SAMPLE = 16,
  	NUM_MIXER = 4,
***************
*** 813,817 ****
  	void nukeResource(int type, int i);	
  	byte *getResourceAddress(int type, int i);
! 	byte *getStringAddress(int i);
  	byte *getStringAddressVar(int i);
  	void ensureResourceLoaded(int type, int i);
--- 817,821 ----
  	void nukeResource(int type, int i);	
  	byte *getResourceAddress(int type, int i);
! 	byte *getStringAddress(int i);
  	byte *getStringAddressVar(int i);
  	void ensureResourceLoaded(int type, int i);
***************
*** 828,832 ****
      void loadRoomObjectsSmall();
  	void readArrayFromIndexFile();
! 	void readMAXS();
  	uint32 isGlobInMemory(int type, int index);
  	virtual void readIndexFile();
--- 832,836 ----
      void loadRoomObjectsSmall();
  	void readArrayFromIndexFile();
! 	void readMAXS();
  	uint32 isGlobInMemory(int type, int index);
  	virtual void readIndexFile();
***************
*** 988,991 ****
--- 992,996 ----
  	byte _soundQue2Pos, _soundQue2[10];
  	bool _soundsPaused, _soundsPaused2;
+ 	bool _soundVolumePreset;
  
  	void setupSound();
***************
*** 1697,1703 ****
  
  	byte VAR_DEFAULT_TALK_DELAY;
! 	byte VAR_CHARSET_MASK;
! 
! 	byte VAR_CUSTOMSCALETABLE;
  	byte VAR_VIDEONAME;
  
--- 1702,1708 ----
  
  	byte VAR_DEFAULT_TALK_DELAY;
! 	byte VAR_CHARSET_MASK;
! 
! 	byte VAR_CUSTOMSCALETABLE;
  	byte VAR_VIDEONAME;
  





More information about the Scummvm-git-logs mailing list