From: Guido de J. <gu...@us...> - 2005-02-23 20:47:09
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7876/gemrb/plugins/ACMImporter Modified Files: ACMImp.cpp ACMImp.h Log Message: improved portability: changed long to int Index: ACMImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/ACMImp.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ACMImp.cpp 4 Oct 2004 22:02:59 -0000 1.59 --- ACMImp.cpp 23 Feb 2005 20:47:00 -0000 1.60 *************** *** 319,330 **** CSoundReader* acm; acm = CreateSoundReader( stream, type, stream->Size(), true ); ! long cnt = acm->get_length(); ! long riff_chans = acm->get_channels(); ! long samplerate = acm->get_samplerate(); //multiply always by 2 because it is in 16 bits ! long rawsize = cnt * riff_chans * 2; unsigned char * memory = (unsigned char*) malloc(rawsize); //multiply always with 2 because it is in 16 bits ! long cnt1 = acm->read_samples( ( short* ) memory, cnt ) * riff_chans * 2; //Sound Length in milliseconds if (time_length) *time_length = ((cnt / riff_chans) * 1000) / samplerate; --- 319,330 ---- CSoundReader* acm; acm = CreateSoundReader( stream, type, stream->Size(), true ); ! int cnt = acm->get_length(); ! int riff_chans = acm->get_channels(); ! int samplerate = acm->get_samplerate(); //multiply always by 2 because it is in 16 bits ! int rawsize = cnt * riff_chans * 2; unsigned char * memory = (unsigned char*) malloc(rawsize); //multiply always with 2 because it is in 16 bits ! int cnt1 = acm->read_samples( ( short* ) memory, cnt ) * riff_chans * 2; //Sound Length in milliseconds if (time_length) *time_length = ((cnt / riff_chans) * 1000) / samplerate; *************** *** 348,352 **** * the default flags are: GEM_SND_RELATIVE */ ! unsigned long ACMImp::Play(const char* ResRef, int XPos, int YPos, unsigned long flags) { unsigned int i; --- 348,352 ---- * the default flags are: GEM_SND_RELATIVE */ ! unsigned int ACMImp::Play(const char* ResRef, int XPos, int YPos, unsigned int flags) { unsigned int i; *************** *** 442,446 **** } ! unsigned long ACMImp::StreamFile(const char* filename) { char path[_MAX_PATH]; --- 442,446 ---- } ! unsigned int ACMImp::StreamFile(const char* filename) { char path[_MAX_PATH]; *************** *** 530,534 **** } ! void ACMImp::UpdateVolume( unsigned long which ) { if ((GEM_SND_VOL_MUSIC & which) && alIsSource( MusicSource )) { --- 530,534 ---- } ! void ACMImp::UpdateVolume( unsigned int which ) { if ((GEM_SND_VOL_MUSIC & which) && alIsSource( MusicSource )) { Index: ACMImp.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/ACMImporter/ACMImp.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ACMImp.h 17 Oct 2004 17:01:50 -0000 1.28 --- ACMImp.h 23 Feb 2005 20:47:00 -0000 1.29 *************** *** 67,77 **** ~ACMImp(void); bool Init(void); ! unsigned long Play(const char* ResRef, int XPos = 0, int YPos = 0, unsigned long flags = GEM_SND_RELATIVE); ! unsigned long StreamFile(const char* filename); bool Play(); bool Stop(); void ResetMusics(); void UpdateViewportPos(int XPos, int YPos); ! void UpdateVolume( unsigned long which = GEM_SND_VOL_MUSIC | GEM_SND_VOL_AMBIENTS ); static ALuint LoadSound(const char *sound, int *time_length = NULL); public: --- 67,77 ---- ~ACMImp(void); bool Init(void); ! unsigned int Play(const char* ResRef, int XPos = 0, int YPos = 0, unsigned int flags = GEM_SND_RELATIVE); ! unsigned int StreamFile(const char* filename); bool Play(); bool Stop(); void ResetMusics(); void UpdateViewportPos(int XPos, int YPos); ! void UpdateVolume( unsigned int which = GEM_SND_VOL_MUSIC | GEM_SND_VOL_AMBIENTS ); static ALuint LoadSound(const char *sound, int *time_length = NULL); public: |