mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-26 03:37:53 +00:00
Sound size should only include sound data.
svn-id: r17667
This commit is contained in:
parent
769b2fed46
commit
8d01148b79
@ -2191,6 +2191,7 @@ void ScummEngine_v100he::o100_writeFile() {
|
||||
}
|
||||
|
||||
void ScummEngine_v100he::o100_getResourceSize() {
|
||||
const byte *ptr;
|
||||
int size, type;
|
||||
|
||||
int resid = pop();
|
||||
@ -2214,15 +2215,18 @@ void ScummEngine_v100he::o100_getResourceSize() {
|
||||
int offs;
|
||||
_sound->getHEMusicDetails(resid, offs, size);
|
||||
push(size);
|
||||
return;
|
||||
} else {
|
||||
ptr = getResourceAddress(rtSound, resid);
|
||||
assert(ptr);
|
||||
size = READ_BE_UINT32(ptr + 4) - 40;
|
||||
push(size);
|
||||
}
|
||||
type = rtSound;
|
||||
break;
|
||||
return;
|
||||
default:
|
||||
error("o100_getResourceSize: default type %d", subOp);
|
||||
}
|
||||
|
||||
const byte *ptr = getResourceAddress(type, resid);
|
||||
ptr = getResourceAddress(type, resid);
|
||||
assert(ptr);
|
||||
size = READ_BE_UINT32(ptr + 4) - 8;
|
||||
push(size);
|
||||
|
@ -2163,13 +2163,12 @@ void ScummEngine_v72he::o72_getResourceSize() {
|
||||
int offs;
|
||||
_sound->getHEMusicDetails(resid, offs, size);
|
||||
push(size);
|
||||
return;
|
||||
} else {
|
||||
const byte *ptr = getResourceAddress(rtSound, resid);
|
||||
assert(ptr);
|
||||
size = READ_BE_UINT32(ptr + 4) - 40;
|
||||
push(size);
|
||||
}
|
||||
|
||||
const byte *ptr = getResourceAddress(rtSound, resid);
|
||||
assert(ptr);
|
||||
size = getResourceDataSize(ptr);
|
||||
push(size);
|
||||
}
|
||||
|
||||
void ScummEngine_v72he::o72_setFilePath() {
|
||||
|
@ -806,6 +806,7 @@ void ScummEngine_v80he::o80_pickVarRandom() {
|
||||
}
|
||||
|
||||
void ScummEngine_v80he::o80_getResourceSize() {
|
||||
const byte *ptr;
|
||||
int size, type;
|
||||
|
||||
int resid = pop();
|
||||
@ -817,10 +818,13 @@ void ScummEngine_v80he::o80_getResourceSize() {
|
||||
int offs;
|
||||
_sound->getHEMusicDetails(resid, offs, size);
|
||||
push(size);
|
||||
return;
|
||||
} else {
|
||||
ptr = getResourceAddress(rtSound, resid);
|
||||
assert(ptr);
|
||||
size = READ_BE_UINT32(ptr + 4) - 40;
|
||||
push(size);
|
||||
}
|
||||
type = rtSound;
|
||||
break;
|
||||
return;
|
||||
case 14:
|
||||
type = rtRoomImage;
|
||||
break;
|
||||
@ -837,14 +841,9 @@ void ScummEngine_v80he::o80_getResourceSize() {
|
||||
error("o80_getResourceSize: default type %d", subOp);
|
||||
}
|
||||
|
||||
const byte *ptr = getResourceAddress(type, resid);
|
||||
if (ptr) {
|
||||
size = getResourceDataSize(ptr);
|
||||
} else {
|
||||
debug(0, "o80_getResourceSize: invalid resource type %d id %d", type, resid);
|
||||
size = 0;
|
||||
}
|
||||
|
||||
ptr = getResourceAddress(type, resid);
|
||||
assert(ptr);
|
||||
size = READ_BE_UINT32(ptr + 4) - 8;
|
||||
push(size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user