mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-07 02:39:56 +00:00
Play the correct digital music. (And removed some unnecessary blank lines.)
svn-id: r18567
This commit is contained in:
parent
1a8f4ae3be
commit
d58e018004
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user