aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-07-19 21:34:46 +0000
committerTorbjörn Andersson2005-07-19 21:34:46 +0000
commitd58e0180044a5895a062b6272dd9e7bdc2a124f8 (patch)
tree01d4dda9d8ca8649648b71d94de58b8251393b28 /saga
parent1a8f4ae3be659b0c66072e6d657ef0fd69c66312 (diff)
downloadscummvm-rg350-d58e0180044a5895a062b6272dd9e7bdc2a124f8.tar.gz
scummvm-rg350-d58e0180044a5895a062b6272dd9e7bdc2a124f8.tar.bz2
scummvm-rg350-d58e0180044a5895a062b6272dd9e7bdc2a124f8.zip
Play the correct digital music. (And removed some unnecessary blank lines.)
svn-id: r18567
Diffstat (limited to 'saga')
-rw-r--r--saga/music.cpp6
-rw-r--r--saga/rscfile.cpp3
-rw-r--r--saga/sndres.cpp3
3 files changed, 1 insertions, 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