[Scummvm-cvs-logs] CVS: scummvm scumm.h,1.135,1.136 sound.cpp,1.54,1.55

James Brown ender at users.sourceforge.net
Mon Apr 22 04:37:08 CEST 2002


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

Modified Files:
	scumm.h sound.cpp 
Log Message:
Fix MP3 compilation.



Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** scumm.h	22 Apr 2002 08:16:10 -0000	1.135
--- scumm.h	22 Apr 2002 11:36:41 -0000	1.136
***************
*** 1018,1022 ****
  	void playBundleSound(char *sound);
  	int playSfxSound(void *sound, uint32 size, uint rate);
!  	void playSfxSound_MP3(void *sound, uint32 size);
  	void stopSfxSound();
  
--- 1018,1022 ----
  	void playBundleSound(char *sound);
  	int playSfxSound(void *sound, uint32 size, uint rate);
!  	int playSfxSound_MP3(void *sound, uint32 size);
  	void stopSfxSound();
  

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** sound.cpp	22 Apr 2002 11:18:11 -0000	1.54
--- sound.cpp	22 Apr 2002 11:36:41 -0000	1.55
***************
*** 25,28 ****
--- 25,29 ----
  #include "sound/mididrv.h"
  #include "sound/imuse.h"
+ #include <sys/stat.h>
  
  #ifdef _WIN32_WCE
***************
*** 210,214 ****
  		if (result == NULL) {
  			warning("startTalkSound: did not find sound at offset %d !", offset);
! 			return;
  		}
  		if (2 * num != result->num_tags) {
--- 211,215 ----
  		if (result == NULL) {
  			warning("startTalkSound: did not find sound at offset %d !", offset);
! 			return -1;
  		}
  		if (2 * num != result->num_tags) {
***************
*** 444,451 ****
  			/* no need to free the memory since error will shut down */
  			error("startSfxSound: cannot read %d bytes", size);
! 			return;
  		}
! 		playSfxSound_MP3(data, file_size);
! 		return;
  	}
  #endif
--- 445,451 ----
  			/* no need to free the memory since error will shut down */
  			error("startSfxSound: cannot read %d bytes", size);
! 			return -1;
  		}
! 		return playSfxSound_MP3(data, file_size);
  	}
  #endif
***************
*** 610,622 ****
  }
  
! void Scumm::playSfxSound_MP3(void *sound, uint32 size)
  {
- 
  #ifdef COMPRESSED_SOUND_FILE
  	if (_soundsPaused)
! 		return;
! 	_mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
! 
  #endif
  }
  
--- 610,621 ----
  }
  
! int Scumm::playSfxSound_MP3(void *sound, uint32 size)
  {
  #ifdef COMPRESSED_SOUND_FILE
  	if (_soundsPaused)
! 		return -1;
! 	return _mixer->play_mp3(NULL, sound, size, SoundMixer::FLAG_AUTOFREE);
  #endif
+ 	return -1;
  }
  
***************
*** 714,717 ****
--- 713,717 ----
  }
  		
+ 
  void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
  	int index;
***************
*** 733,737 ****
  
  	// Calc offset
! 	frame_size = 144 * _mad_header[index].bitrate / _mad_header[index].samplerate;
  	offset = (long)( (float)start / (float)75 * ((float)_mad_header[index].bitrate/(float)8));
  	
--- 733,737 ----
  
  	// Calc offset
! 	frame_size = (float)(144 * _mad_header[index].bitrate / _mad_header[index].samplerate);
  	offset = (long)( (float)start / (float)75 * ((float)_mad_header[index].bitrate/(float)8));
  	





More information about the Scummvm-git-logs mailing list