[Scummvm-cvs-logs] CVS: scummvm 2xsai.cpp,1.3,1.4 gfx.cpp,1.82,1.83 resource.cpp,1.74,1.75 scumm.h,1.145,1.146 scummvm.cpp,1.128,1.129 sound.cpp,1.60,1.61

Lionel Ulmer bbrox at users.sourceforge.net
Sat Apr 27 01:34:12 CEST 2002


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

Modified Files:
	2xsai.cpp gfx.cpp resource.cpp scumm.h scummvm.cpp sound.cpp 
Log Message:
MP3 CD tracks should now be working properly.

Ludde, maybe you should check if Simon is still working OK as now the
change of the sound playing handle is 'asynchronous' (ie if you call
'stop' on a sound, the handle will NOT be put to NULL right away, but
at the next 'mix' thread call). Maybe we should completely remove this
handle stuff and always use instead the index returned by the
'play_XXX' functions.



Index: 2xsai.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/2xsai.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** 2xsai.cpp	24 Apr 2002 07:42:29 -0000	1.3
--- 2xsai.cpp	27 Apr 2002 07:42:13 -0000	1.4
***************
*** 743,755 ****
  	for(int j = 0; j < height; ++j) {
  		for(int i = 0; i < width; ++i) {
! 			short A = *(p + i - nextlineSrc - 1);
  			short B = *(p + i - nextlineSrc);
! 			short C = *(p + i - nextlineSrc + 1);
  			short D = *(p + i - 1);
  			short E = *(p + i );
  			short F = *(p + i + 1);
! 			short G = *(p + i + nextlineSrc - 1);
  			short H = *(p + i + nextlineSrc);
! 			short I = *(p + i + nextlineSrc + 1);
  
  			*(q + (i << 1)) = D == B && B != F && D != H ? D : E;
--- 743,755 ----
  	for(int j = 0; j < height; ++j) {
  		for(int i = 0; i < width; ++i) {
! 			// short A = *(p + i - nextlineSrc - 1);
  			short B = *(p + i - nextlineSrc);
! 			// short C = *(p + i - nextlineSrc + 1);
  			short D = *(p + i - 1);
  			short E = *(p + i );
  			short F = *(p + i + 1);
! 			// short G = *(p + i + nextlineSrc - 1);
  			short H = *(p + i + nextlineSrc);
! 			// short I = *(p + i + nextlineSrc + 1);
  
  			*(q + (i << 1)) = D == B && B != F && D != H ? D : E;

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** gfx.cpp	26 Apr 2002 11:01:47 -0000	1.82
--- gfx.cpp	27 Apr 2002 07:42:13 -0000	1.83
***************
*** 209,213 ****
  	byte *ptr;
  	int scrollY;
- 	int width = w;
  	int height;
  
--- 209,212 ----

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** resource.cpp	26 Apr 2002 18:52:33 -0000	1.74
--- resource.cpp	27 Apr 2002 07:42:13 -0000	1.75
***************
*** 424,428 ****
  	memset(_charsetData, 0, sizeof(_charsetData));
  
! 	assert(no < sizeof(_charsetData)/16);
  	checkRange(_maxCharsets - 1, 1, no, "Loading illegal charset %d");
  
--- 424,428 ----
  	memset(_charsetData, 0, sizeof(_charsetData));
  
! 	assert(no < (int) sizeof(_charsetData)/16);
  	checkRange(_maxCharsets - 1, 1, no, "Loading illegal charset %d");
  

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** scumm.h	27 Apr 2002 04:31:24 -0000	1.145
--- scumm.h	27 Apr 2002 07:42:13 -0000	1.146
***************
*** 973,977 ****
  
  	#define CACHE_TRACKS 10
- 	#define MP3_BUFFER_SIZE 200000
  
  	/* used for mp3 CD music */
--- 973,976 ----
***************
*** 982,987 ****
  	long _mp3_size[CACHE_TRACKS];
  	FILE* _mp3_tracks[CACHE_TRACKS];
! 	void* _mp3_buffer;
! 	PlayingSoundHandle _mp3_handle;
  
  	int getCachedTrack(int track);
--- 981,985 ----
  	long _mp3_size[CACHE_TRACKS];
  	FILE* _mp3_tracks[CACHE_TRACKS];
! 	int _mp3_index;
  
  	int getCachedTrack(int track);

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -C2 -d -r1.128 -r1.129
*** scummvm.cpp	27 Apr 2002 04:31:24 -0000	1.128
--- scummvm.cpp	27 Apr 2002 07:42:14 -0000	1.129
***************
*** 171,175 ****
  #ifdef COMPRESSED_SOUND_FILE
  	_current_cache = 0;
- 	_mp3_buffer = NULL;
  #endif
  }
--- 171,174 ----

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** sound.cpp	26 Apr 2002 17:22:58 -0000	1.60
--- sound.cpp	27 Apr 2002 07:42:14 -0000	1.61
***************
*** 146,150 ****
  		if (_talkChannel < 0)
  			finished = false;
! 		else if (this->_mixer->_channels[_talkChannel] == NULL)
  			finished = true;
  		else
--- 146,150 ----
  		if (_talkChannel < 0)
  			finished = false;
! 		else if (_mixer->_channels[_talkChannel] == NULL)
  			finished = true;
  		else
***************
*** 708,713 ****
  	_mp3_size[current_index] = ftell(file);
  	_mp3_tracks[current_index] = file;
- 	if (!_mp3_buffer)
- 		_mp3_buffer = malloc(MP3_BUFFER_SIZE);
  	
  	return current_index;
--- 708,711 ----
***************
*** 730,734 ****
  
  	if (!num_loops && !start) {
! 		_mixer->stop(_mp3_handle);
  		return 0;
  	}
--- 728,732 ----
  
  	if (!num_loops && !start) {
! 		_mixer->stop(_mp3_index);
  		return 0;
  	}
***************
*** 752,756 ****
  	fseek(_mp3_tracks[index], offset, SEEK_SET);
  
! 	_mixer->play_mp3_cdtrack(&_mp3_handle, _mp3_tracks[index], _mp3_buffer, MP3_BUFFER_SIZE, duration);
  	return 0;
  }
--- 750,754 ----
  	fseek(_mp3_tracks[index], offset, SEEK_SET);
  
! 	_mp3_index = _mixer->play_mp3_cdtrack(NULL, _mp3_index, _mp3_tracks[index], duration);
  	return 0;
  }





More information about the Scummvm-git-logs mailing list