From d58e0180044a5895a062b6272dd9e7bdc2a124f8 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 19 Jul 2005 21:34:46 +0000 Subject: Play the correct digital music. (And removed some unnecessary blank lines.) svn-id: r18567 --- saga/music.cpp | 6 +----- saga/rscfile.cpp | 3 --- saga/sndres.cpp | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/saga/music.cpp b/saga/music.cpp index 35d53d2708..84cb4c9ea7 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -85,7 +85,6 @@ RAWInputStream::RAWInputStream(SagaEngine *vm, ResourceContext *context, uint32 refill(); } - int RAWInputStream::readBuffer(int16 *buffer, const int numSamples) { int samples = 0; while (samples < numSamples && !eosIntern()) { @@ -366,13 +365,10 @@ void Music::play(uint32 resourceId, MusicFlags flags) { } _trackNumber = resourceId; - _player->stopMusic(); - _mixer->stopHandle(_musicHandle); if (_vm->getGameType() == GType_ITE) { - if (resourceId >= 9 && resourceId <= 34) { if (flags == MUSIC_DEFAULT) { if ((resourceId == 13) || (resourceId == 19)) { @@ -384,7 +380,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) { if (_musicContext != NULL) { //TODO: check resource size - audioStream = new RAWInputStream(_vm, _musicContext, resourceId, flags == MUSIC_LOOP); + audioStream = new RAWInputStream(_vm, _musicContext, resourceId - 9, flags == MUSIC_LOOP); } } } diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp index f40272c88e..b6eac5cdfe 100644 --- a/saga/rscfile.cpp +++ b/saga/rscfile.cpp @@ -59,8 +59,6 @@ bool Resource::loadContext(ResourceContext *context) { context->isBigEndian = ((_vm->getFeatures() & GF_BIG_ENDIAN_VOICES) != 0) && ((context->fileType & GAME_VOICEFILE) != 0); } - - if (context->file->size() < RSC_MIN_FILESIZE) { return false; } @@ -89,7 +87,6 @@ bool Resource::loadContext(ResourceContext *context) { context->file->seek((long)resourceTableOffset, SEEK_SET); - result = (context->file->read(tableBuffer, tableSize) == tableSize); if (result) { context->table = (ResourceData *)calloc(context->count, sizeof(*context->table)); diff --git a/saga/sndres.cpp b/saga/sndres.cpp index d19c50089c..46ca5aa1d1 100644 --- a/saga/sndres.cpp +++ b/saga/sndres.cpp @@ -201,13 +201,11 @@ int SndRes::getVoiceLength(uint32 resourceId) { bool voiceFile = false; double msDouble; SoundBuffer buffer; - if (!load(_voiceContext, resourceId, buffer, true)) { return -1; } - msDouble = (double)buffer.size; if (buffer.sampleBits == 16) { msDouble /= 2.0; @@ -218,7 +216,6 @@ int SndRes::getVoiceLength(uint32 resourceId) { msDouble = msDouble / buffer.frequency * 1000.0; return (int)msDouble; - } } // End of namespace Saga -- cgit v1.2.3