aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2005-08-10 06:16:26 +0000
committerJonathan Gray2005-08-10 06:16:26 +0000
commit3c1b5648aed0be45b303cea49e7537c98dd4a001 (patch)
treebd810ba197c9ceeab024be3f4b602c558b92019f
parentc6c5c8f868c0c0ea37ddef156b8581d304ad5cac (diff)
downloadscummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.tar.gz
scummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.tar.bz2
scummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.zip
Rest of the changes required for tremor to actually work.
Based on patches against 0.7.1 by Jolan Luff. svn-id: r18641
-rw-r--r--base/engine.cpp2
-rw-r--r--base/main.cpp3
-rw-r--r--queen/sound.cpp4
-rw-r--r--queen/sound.h2
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp4
-rw-r--r--scumm/smush/smush_player.cpp4
-rw-r--r--scumm/sound.cpp4
-rw-r--r--simon/sound.cpp6
-rw-r--r--sound/audiocd.cpp8
-rw-r--r--sound/audiostream.cpp8
-rw-r--r--sound/vorbis.cpp14
-rw-r--r--sound/vorbis.h2
-rw-r--r--sword1/animation.cpp4
-rw-r--r--sword1/music.cpp4
-rw-r--r--sword1/sound.cpp4
-rw-r--r--sword1/sword1.cpp2
-rw-r--r--sword2/driver/d_sound.cpp4
17 files changed, 36 insertions, 43 deletions
diff --git a/base/engine.cpp b/base/engine.cpp
index d84728a2e0..0fd5aaee6e 100644
--- a/base/engine.cpp
+++ b/base/engine.cpp
@@ -94,7 +94,7 @@ void Engine::checkCD() {
// If we can find a compressed audio track, then it should be ok even
// if it's running from CD.
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (Common::File::exists("track1.ogg"))
return;
#endif
diff --git a/base/main.cpp b/base/main.cpp
index edf970fe02..47e70194fd 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -97,6 +97,9 @@ const char *gScummVMVersion = "0.8.0CVS";
const char *gScummVMBuildDate = __DATE__ " " __TIME__;
const char *gScummVMFullVersion = "ScummVM 0.8.0CVS (" __DATE__ " " __TIME__ ")";
const char *gScummVMFeatures = ""
+#ifdef USE_TREMOR
+ "Tremor "
+#endif
#ifdef USE_VORBIS
"Vorbis "
#endif
diff --git a/queen/sound.cpp b/queen/sound.cpp
index 97f464989c..d9f3b84cc5 100644
--- a/queen/sound.cpp
+++ b/queen/sound.cpp
@@ -60,7 +60,7 @@ Sound *Sound::giveSound(Audio::Mixer *mixer, QueenEngine *vm, uint8 compression)
#endif
break;
case COMPRESSION_OGG:
-#ifndef USE_VORBIS
+#if !defined(USE_VORBIS) && !defined(USE_TREMOR)
warning("Using OGG compressed datafile, but OGG support not compiled in");
return new SilentSound(mixer, vm);
#else
@@ -205,7 +205,7 @@ void MP3Sound::sfxPlay(const char *name, bool isSpeech) {
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
void OGGSound::sfxPlay(const char *name, bool isSpeech) {
uint32 size;
Common::File *f = _vm->resource()->giveCompressedSound(name, &size);
diff --git a/queen/sound.h b/queen/sound.h
index 5ab078d150..fdc6cd2e03 100644
--- a/queen/sound.h
+++ b/queen/sound.h
@@ -138,7 +138,7 @@ public:
};
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
class OGGSound : public Sound {
public:
OGGSound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 4c47ddaf16..508ae8e495 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -588,7 +588,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(soundStruct *soundHandle, int region, b
if (!len) {
sprintf(fileName, "%s_reg%03d.ogg", soundHandle->name, region);
cmpFile = soundHandle->bundle->getFile(fileName, offs, len);
-#ifndef USE_VORBIS
+#if !defined(USE_VORBIS) && !defined(USE_TREMOR)
if (len)
error("Vorbis library compiled support needed!");
#endif
@@ -596,7 +596,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(soundStruct *soundHandle, int region, b
oggMode = true;
}
if (!soundHandle->compressedStream) {
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (oggMode)
soundHandle->compressedStream = makeVorbisStream(cmpFile, len);
#endif
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 9ce66eb44e..e3b2d836e4 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -1199,7 +1199,7 @@ void SmushPlayer::tryCmpFile(const char *filename) {
if (i == NULL) {
error("invalid filename : %s", filename);
}
-#if defined(USE_MAD) || defined(USE_VORBIS)
+#if defined(USE_MAD) || defined(USE_VORBIS) || defined(USE_TREMOR)
char fname[260];
#endif
#ifdef USE_MAD
@@ -1213,7 +1213,7 @@ void SmushPlayer::tryCmpFile(const char *filename) {
return;
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
memcpy(fname, filename, i - filename);
strcpy(fname + (i - filename), ".ogg");
_compressedFile.open(fname);
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index a3ea155c6f..00d9d48610 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -792,7 +792,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
#endif
break;
case kVorbisMode:
- #ifdef USE_VORBIS
+ #if defined(USE_VORBIS) || defined(USE_TREMOR)
assert(size > 0);
input = makeVorbisStream(_sfxFile, size);
#endif
@@ -1124,7 +1124,7 @@ ScummFile *Sound::openSfxFile() {
#ifdef USE_FLAC
{ "sof", kFlacMode },
#endif
- #ifdef USE_VORBIS
+ #if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "sog", kVorbisMode },
#endif
#ifdef USE_MAD
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 606328366d..591d2c9b3e 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -183,7 +183,7 @@ void MP3Sound::playSound(uint sound, Audio::SoundHandle *handle, byte flags)
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
class VorbisSound : public BaseSound {
public:
VorbisSound(Audio::Mixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {};
@@ -271,7 +271,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mix
}
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (!_voice && gss->vorbis_filename && gss->vorbis_filename[0]) {
file->open(gss->vorbis_filename);
if (file->isOpen()) {
@@ -323,7 +323,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mix
}
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (!_effects && gss->vorbis_effects_filename && gss->vorbis_effects_filename[0]) {
file->open(gss->vorbis_effects_filename);
if (file->isOpen()) {
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index 7be50dc4d6..dee17a0910 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -46,13 +46,13 @@ static const TrackFormat TRACK_FORMATS[] = {
/* decoderName, openTrackFunction */
#ifdef USE_FLAC
{ "Flac", getFlacTrack },
-#endif // #ifdef USE_FLAC
-#ifdef USE_VORBIS
+#endif
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "Ogg Vorbis", getVorbisTrack },
-#endif // #ifdef USE_VORBIS
+#endif
#ifdef USE_MAD
{ "Mpeg Layer 3", getMP3Track },
-#endif // #ifdef USE_MAD
+#endif
{ NULL, NULL } // Terminator
};
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 9cab081f69..776322d0fe 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -44,13 +44,13 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = {
#ifdef USE_FLAC
{ "Flac", "flac", makeFlacStream },
{ "Flac", "fla", makeFlacStream },
-#endif // #ifdef USE_FLAC
-#ifdef USE_VORBIS
+#endif
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "Ogg Vorbis", "ogg", makeVorbisStream },
-#endif // #ifdef USE_VORBIS
+#endif
#ifdef USE_MAD
{ "Mpeg Layer 3", "mp3", makeMP3Stream },
-#endif // #ifdef USE_MAD
+#endif
{ NULL, NULL, NULL } // Terminator
};
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index 7c18a83a8e..669293a90f 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -168,16 +168,12 @@ VorbisTrackInfo::~VorbisTrackInfo() {
}
}
-#ifdef CHUNKSIZE
-#define VORBIS_TREMOR
-#endif
-
void VorbisTrackInfo::play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int startFrame, int duration) {
bool err = openTrack();
assert(!err);
-#ifdef VORBIS_TREMOR
+#ifdef USE_TREMOR
ov_time_seek(&_ov_file, (ogg_int64_t)(startFrame / 75.0 * 1000));
#else
ov_time_seek(&_ov_file, startFrame / 75.0);
@@ -234,12 +230,6 @@ public:
};
-
-#ifdef CHUNKSIZE
-#define VORBIS_TREMOR
-#endif
-
-
VorbisInputStream::VorbisInputStream(OggVorbis_File *file, int duration, bool deleteFileAfterUse)
: _ov_file(file),
_bufferEnd(_buffer + ARRAYSIZE(_buffer)),
@@ -290,7 +280,7 @@ void VorbisInputStream::refill() {
while (len_left > 0 && _end_pos > ov_pcm_tell(_ov_file)) {
long result = ov_read(_ov_file, read_pos, len_left,
-#ifndef VORBIS_TREMOR
+#ifndef USE_TREMOR
#ifdef SCUMM_BIG_ENDIAN
1,
#else
diff --git a/sound/vorbis.h b/sound/vorbis.h
index 6f3796afff..fe8da6881f 100644
--- a/sound/vorbis.h
+++ b/sound/vorbis.h
@@ -25,7 +25,7 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
class AudioStream;
class DigitalTrackInfo;
diff --git a/sword1/animation.cpp b/sword1/animation.cpp
index 18082374a3..7b768d0458 100644
--- a/sword1/animation.cpp
+++ b/sword1/animation.cpp
@@ -100,7 +100,7 @@ MoviePlayer::~MoviePlayer(void) {
* @param id the id of the file
*/
void MoviePlayer::play(uint32 id) {
-#if defined(USE_MPEG2) && defined(USE_VORBIS)
+#if defined(USE_MPEG2) && (defined(USE_VORBIS) || defined(USE_TREMOR))
AnimationState *anim = new AnimationState(_scr, _snd, _sys);
AudioStream *stream = NULL;
if (SwordEngine::_systemVars.cutscenePackVersion == 1) {
@@ -166,7 +166,7 @@ void MoviePlayer::play(uint32 id) {
while (!anim->soundFinished())
_sys->delayMillis(100);
delete anim;
-#endif // USE_MPEG2 && USE_VORBIS
+#endif // USE_MPEG2 && (USE_VORBIS || USE_TREMOR)
}
void MoviePlayer::insertOverlay(OverlayColor *buf, uint8 *ovl, OverlayColor *pal) {
diff --git a/sword1/music.cpp b/sword1/music.cpp
index b15fa6145e..ff6c817880 100644
--- a/sword1/music.cpp
+++ b/sword1/music.cpp
@@ -114,7 +114,7 @@ AudioStream *MusicHandle::createAudioSource(void) {
case MusicMp3:
return makeMP3Stream(&_file, _file.size());
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
case MusicVorbis:
return makeVorbisStream(&_file, _file.size());
#endif
@@ -138,7 +138,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
if (_file.open(fileName))
_musicMode = MusicMp3;
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (!_file.isOpen()) { // mp3 doesn't exist (or not compiled with MAD support)
sprintf(fileName, "%s.ogg", fileBase);
if (_file.open(fileName))
diff --git a/sword1/sound.cpp b/sword1/sound.cpp
index ee6aca37b2..b6605b5fd8 100644
--- a/sword1/sound.cpp
+++ b/sword1/sound.cpp
@@ -203,7 +203,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
_waveVolPos = 0;
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
else if (_cowMode == CowVorbis) {
_cowFile.seek(index);
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
@@ -329,7 +329,7 @@ void Sound::initCowSystem(void) {
_cowMode = CowMp3;
}
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
if (!_cowFile.isOpen()) {
sprintf(cowName, "SPEECH%d.CLV", SwordEngine::_systemVars.currentCD);
_cowFile.open(cowName);
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index 4475198940..bb1e6c32a1 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -297,7 +297,7 @@ const CdFile SwordEngine::_cdFileList[] = {
,{ "speech1.cl3", FLAG_SPEECH1 },
{ "speech2.cl3", FLAG_SPEECH2 }
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
,{ "speech1.clv", FLAG_SPEECH1 },
{ "speech2.clv", FLAG_SPEECH2 }
#endif
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index f24646a9af..3b408417f1 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -51,7 +51,7 @@ static AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, int cd
#ifdef USE_MAD
{ "cl3", kMP3Mode },
#endif
- #ifdef USE_VORBIS
+ #if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "clg", kVorbisMode },
#endif
#ifdef USE_FLAC
@@ -135,7 +135,7 @@ static AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, int cd
case kMP3Mode:
return makeMP3Stream(fh->file, enc_len);
#endif
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
case kVorbisMode:
return makeVorbisStream(fh->file, enc_len);
#endif