diff options
-rw-r--r-- | common/engine.h | 4 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 50 | ||||
-rw-r--r-- | scumm/sound.h | 9 | ||||
-rw-r--r-- | sound/mixer.cpp | 2 | ||||
-rw-r--r-- | sound/mixer.h | 2 |
6 files changed, 18 insertions, 51 deletions
diff --git a/common/engine.h b/common/engine.h index 08874ec5c5..27a6845c00 100644 --- a/common/engine.h +++ b/common/engine.h @@ -24,8 +24,8 @@ #include "scummsys.h" #include "system.h" -#define SCUMMVM_VERSION "0.2.2 CVS" -#define SCUMMVM_CVS "2002-09-06" +#define SCUMMVM_VERSION "0.2.7 CVS" +#define SCUMMVM_CVS "2002-10-28+" class SoundMixer; class GameDetector; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 78c430f205..0fd6d2685c 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -325,9 +325,7 @@ void Scumm::scummInit() getGraphicsPerformance(); -#ifdef COMPRESSED_SOUND_FILE _sound->_current_cache = 0; -#endif _timer->installProcedure(&autosave, 5 * 60 * 1000); } diff --git a/scumm/sound.cpp b/scumm/sound.cpp index acd7bf9165..8cbd8e673b 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -453,13 +453,11 @@ void Sound::processSfxQueues() { } } -#ifdef COMPRESSED_SOUND_FILE static int compar(const void *a, const void *b) { return ((MP3OffsetTable *) a)->org_offset - ((MP3OffsetTable *) b)->org_offset; } -#endif int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { int num = 0, i; @@ -491,7 +489,7 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { if (b > 8) { num = (b - 8) >> 1; } -#ifdef COMPRESSED_SOUND_FILE + if (offset_table != NULL) { MP3OffsetTable *result = NULL, key; @@ -510,9 +508,7 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { } offset = result->new_offset; size = result->compressed_size; - } else -#endif - { + } else { offset += 8; size = -1; } @@ -738,11 +734,10 @@ int Sound::startSfxSound(File *file, int file_size) { int rate, comp; byte *data; -#ifdef COMPRESSED_SOUND_FILE if (file_size > 0) { int alloc_size = file_size; #ifdef USE_MAD - if (! _vorbis_mode) + if (!_vorbis_mode) alloc_size += MAD_BUFFER_GUARD; #endif data = (byte *)calloc(alloc_size, 1); @@ -757,7 +752,7 @@ int Sound::startSfxSound(File *file, int file_size) { else return playSfxSound_MP3(data, file_size); } -#endif + if (file->read(ident, 8) != 8) goto invalid; @@ -810,7 +805,6 @@ File * Sound::openSfxFile() { /* Try opening the file <_exe_name>.sou first, eg tentacle.sou. * That way, you can keep .sou files for multiple games in the * same directory */ -#ifdef COMPRESSED_SOUND_FILE offset_table = NULL; #ifdef USE_MAD @@ -820,19 +814,19 @@ File * Sound::openSfxFile() { } if (file->isOpen()) _vorbis_mode = false; - else #endif + #ifdef USE_VORBIS - { - sprintf(buf, "%s.sog", _scumm->_exe_name); - if (!file->open(buf, _scumm->getGameDataPath())) - file->open("monster.sog", _scumm->getGameDataPath()); - if (file->isOpen()) - _vorbis_mode = true; - } + if (!file->isOpen()) { + sprintf(buf, "%s.sog", _scumm->_exe_name); + if (!file->open(buf, _scumm->getGameDataPath())) + file->open("monster.sog", _scumm->getGameDataPath()); + if (file->isOpen()) + _vorbis_mode = true; + } #endif - if (file->isOpen() == true) { + if (file->isOpen()) { /* Now load the 'offset' index in memory to be able to find the MP3 data The format of the .SO3 file is easy : @@ -849,7 +843,6 @@ File * Sound::openSfxFile() { */ int size, compressed_offset; MP3OffsetTable *cur; - compressed_offset = file->readUint32BE(); offset_table = (MP3OffsetTable *) malloc(compressed_offset); num_sound_effects = compressed_offset / 16; @@ -866,7 +859,7 @@ File * Sound::openSfxFile() { } return file; } -#endif + sprintf(buf, "%s.sou", _scumm->_exe_name); if (!file->open(buf, _scumm->getGameDataPath())) { file->open("monster.sou", _scumm->getGameDataPath()); @@ -1286,9 +1279,7 @@ void Sound::stopCDTimer() void Sound::playCDTrack(int track, int num_loops, int start, int delay) { -#ifdef COMPRESSED_SOUND_FILE if (playMP3CDTrack(track, num_loops, start, delay) == -1) -#endif _scumm->_system->play_cdrom(track, num_loops, start, delay); // Start the timer after starting the track. Starting an MP3 track is @@ -1301,31 +1292,24 @@ void Sound::playCDTrack(int track, int num_loops, int start, int delay) void Sound::stopCD() { stopCDTimer(); -#ifdef COMPRESSED_SOUND_FILE if (stopMP3CD() == -1) -#endif _scumm->_system->stop_cdrom(); } int Sound::pollCD() { -#ifdef COMPRESSED_SOUND_FILE if (pollMP3CD()) return 1; -#endif + return _scumm->_system->poll_cdrom(); } void Sound::updateCD() { -#ifdef COMPRESSED_SOUND_FILE if (updateMP3CD() == -1) -#endif _scumm->_system->update_cdrom(); } -#ifdef COMPRESSED_SOUND_FILE - int Sound::getCachedTrack(int track) { int i; char track_name[1024]; @@ -1381,7 +1365,7 @@ int Sound::getCachedTrack(int track) { } #endif - debug(1, "Track %d not available in compressed format", track); + debug(2, "Track %d not available in compressed format", track); return -1; } @@ -1651,5 +1635,3 @@ Sound::VorbisTrackInfo::~VorbisTrackInfo() { } #endif - -#endif diff --git a/scumm/sound.h b/scumm/sound.h index 503d5a5872..d382a10a91 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -65,7 +65,6 @@ enum { uint16 _mouthSyncTimes[52]; uint _curSoundPos; -#ifdef COMPRESSED_SOUND_FILE MP3OffsetTable *offset_table; // SO3 MP3 compressed audio int num_sound_effects; // SO3 MP3 compressed audio bool _vorbis_mode; // true if using SOG, false if using SO3 @@ -122,18 +121,12 @@ enum { }; #endif -#endif - Scumm * _scumm; public: -#ifdef COMPRESSED_SOUND_FILE - int _current_cache; -#endif - int _talkChannel; /* Mixer channel actor is talking on */ int _cd_timer_value; bool _soundsPaused; @@ -184,13 +177,11 @@ public: void updateCD(); protected: -#ifdef COMPRESSED_SOUND_FILE int getCachedTrack(int track); int playMP3CDTrack(int track, int num_loops, int start, int delay); int stopMP3CD(); int pollMP3CD(); int updateMP3CD(); -#endif }; #endif diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 6faaf22c67..e176e93431 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -262,12 +262,10 @@ void SoundMixer::setMusicVolume(int volume) { _musicVolume = volume; } -#ifdef COMPRESSED_SOUND_FILE bool SoundMixer::Channel::soundFinished() { warning("sound_finished should never be called on a non-MP3 mixer "); return false; } -#endif void SoundMixer::Channel::append(void * sound, uint32 size) { error("append method should never be called on something else than a _STREAM mixer "); diff --git a/sound/mixer.h b/sound/mixer.h index be763c2228..14897b5834 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -52,9 +52,7 @@ private: } virtual void realDestroy() = 0; virtual void append(void *sound, uint32 size); -#ifdef COMPRESSED_SOUND_FILE virtual bool soundFinished(); -#endif }; class ChannelRaw : public Channel { |