[Scummvm-cvs-logs] CVS: scummvm scumm.h,1.139,1.140 sound.cpp,1.56,1.57

James Brown ender at users.sourceforge.net
Wed Apr 24 00:20:01 CEST 2002


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

Modified Files:
	scumm.h sound.cpp 
Log Message:
Fix MI1 CD Music, I hope.



Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -d -r1.139 -r1.140
*** scumm.h	24 Apr 2002 04:26:09 -0000	1.139
--- scumm.h	24 Apr 2002 07:19:00 -0000	1.140
***************
*** 984,990 ****
  
  	int getCachedTrack(int track);
! 	void playMP3CDTrack(int track, int num_loops, int start, int delay);
! 
! 
  #endif
  
--- 984,988 ----
  
  	int getCachedTrack(int track);
! 	int playMP3CDTrack(int track, int num_loops, int start, int delay);
  #endif
  

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** sound.cpp	22 Apr 2002 19:29:22 -0000	1.56
--- sound.cpp	24 Apr 2002 07:19:00 -0000	1.57
***************
*** 109,118 ****
  		ptr += 8;
  #ifdef COMPRESSED_SOUND_FILE
! 		playMP3CDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
! 						(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
! #else
   		_system->play_cdrom(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
   						(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
! #endif
  		current_cd_sound = sound;
  		return;
--- 109,118 ----
  		ptr += 8;
  #ifdef COMPRESSED_SOUND_FILE
! 		if ((playMP3CDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
! 						(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0)) == -1)
! #endif
   		_system->play_cdrom(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
   						(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
! 
  		current_cd_sound = sound;
  		return;
***************
*** 649,653 ****
  	_mp3_tracks[current_index] = NULL;
  	if (!file) {
! 		warning("Track %d not available in mp3 format", track);
  		return -1;
  	}
--- 649,654 ----
  	_mp3_tracks[current_index] = NULL;
  	if (!file) {
! 		// This warning is pretty pointless.
! 		debug(1, "Track %d not available in mp3 format", track);
  		return -1;
  	}
***************
*** 714,718 ****
  		
  
! void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
  	int index;
  	long offset;
--- 715,719 ----
  		
  
! int Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
  	int index;
  	long offset;
***************
*** 721,734 ****
  
  	if (_soundsPaused)
! 		return;
  
  	if (!num_loops && !start) {
  		_mixer->stop(_mp3_handle);
! 		return;
  	}
  
  	index = getCachedTrack(track);
  	if (index < 0)
! 		return;
  
  	// Calc offset
--- 722,735 ----
  
  	if (_soundsPaused)
! 		return 0;
  
  	if (!num_loops && !start) {
  		_mixer->stop(_mp3_handle);
! 		return 0;
  	}
  
  	index = getCachedTrack(track);
  	if (index < 0)
! 		return -1;
  
  	// Calc offset
***************
*** 747,751 ****
  
  	_mixer->play_mp3_cdtrack(&_mp3_handle, _mp3_tracks[index], _mp3_buffer, MP3_BUFFER_SIZE, duration);
! 
  }
  
--- 748,752 ----
  
  	_mixer->play_mp3_cdtrack(&_mp3_handle, _mp3_tracks[index], _mp3_buffer, MP3_BUFFER_SIZE, duration);
! 	return 0;
  }
  





More information about the Scummvm-git-logs mailing list