diff options
Diffstat (limited to 'resource.cpp')
-rw-r--r-- | resource.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/resource.cpp b/resource.cpp index f3733b7580..c26b7bebcf 100644 --- a/resource.cpp +++ b/resource.cpp @@ -657,45 +657,45 @@ int Scumm::readSoundResource(int type, int index) { basetag = fileReadDwordLE(); total_size = fileReadDwordBE(); -#if defined(SAMNMAX) || defined(FULL_THROTTLE) - if (basetag == MKID('MIDI')) { - fileSeek(_fileHandle, -8, SEEK_CUR); - fileRead(_fileHandle,createResource(type, index, total_size+8), total_size+8); - return 1; - } -#else - best_pri = -1; - while (pos < total_size) { - tag = fileReadDword(); - size = fileReadDwordBE() + 8; - pos += size; + if (_gameId==GID_SAMNMAX) { + if (basetag == MKID('MIDI')) { + fileSeek(_fileHandle, -8, SEEK_CUR); + fileRead(_fileHandle,createResource(type, index, total_size+8), total_size+8); + return 1; + } + } else { + best_pri = -1; + while (pos < total_size) { + tag = fileReadDword(); + size = fileReadDwordBE() + 8; + pos += size; - switch(tag) { + switch(tag) { #ifdef USE_ADLIB - case MKID('ADL '): pri = 10; break; + case MKID('ADL '): pri = 10; break; #else - case MKID('ROL '): pri = 1; break; - case MKID('GMD '): pri = 2; break; + case MKID('ROL '): pri = 1; break; + case MKID('GMD '): pri = 2; break; #endif - default: pri = -1; - } + default: pri = -1; + } - if (pri > best_pri) { - best_pri = pri; - best_size = size; - best_offs = filePos(_fileHandle); + if (pri > best_pri) { + best_pri = pri; + best_size = size; + best_offs = filePos(_fileHandle); + } + + fileSeek(_fileHandle, size - 8, SEEK_CUR); } - fileSeek(_fileHandle, size - 8, SEEK_CUR); - } + if (best_pri != -1) { + fileSeek(_fileHandle, best_offs - 8, SEEK_SET); + fileRead(_fileHandle,createResource(type, index, best_size), best_size); + return 1; + } - if (best_pri != -1) { - fileSeek(_fileHandle, best_offs - 8, SEEK_SET); - fileRead(_fileHandle,createResource(type, index, best_size), best_size); - return 1; } - -#endif res.roomoffs[type][index] = 0xFFFFFFFF; return 0; } |