diff options
author | Johannes Schickel | 2014-01-22 00:53:21 +0100 |
---|---|---|
committer | Johannes Schickel | 2014-01-22 00:53:21 +0100 |
commit | 047df69407fabf19385012bf8e2ebb55906ba228 (patch) | |
tree | b41d62b19936b3623e2bda611482cb3f2eaedd99 /engines/agos/res_snd.cpp | |
parent | 1cee8439e70e26427ac5ff04f559016db99bf66b (diff) | |
download | scummvm-rg350-047df69407fabf19385012bf8e2ebb55906ba228.tar.gz scummvm-rg350-047df69407fabf19385012bf8e2ebb55906ba228.tar.bz2 scummvm-rg350-047df69407fabf19385012bf8e2ebb55906ba228.zip |
AGOS: Use Common::File instead of SearchMan.
This makes sure the hack from Common::File for filenames with a trailing dot
is used as expected.
Diffstat (limited to 'engines/agos/res_snd.cpp')
-rw-r--r-- | engines/agos/res_snd.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index c56eb53a01..86d24e0b07 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -450,17 +450,14 @@ static const char *const dimpSoundList[32] = { void AGOSEngine::loadSoundFile(const char* filename) { - Common::SeekableReadStream *in; - - in = SearchMan.createReadStreamForMember(filename); - if (!in) + Common::File in; + if (!in.open(filename)) error("loadSound: Can't load %s", filename); - uint32 dstSize = in->size(); + uint32 dstSize = in.size(); byte *dst = (byte *)malloc(dstSize); - if (in->read(dst, dstSize) != dstSize) + if (in.read(dst, dstSize) != dstSize) error("loadSound: Read failed"); - delete in; _sound->playSfxData(dst, 0, 0, 0); } @@ -469,21 +466,19 @@ void AGOSEngine::loadSound(uint16 sound, int16 pan, int16 vol, uint16 type) { byte *dst; if (getGameId() == GID_DIMP) { - Common::SeekableReadStream *in; + Common::File in; char filename[15]; assert(sound >= 1 && sound <= 32); sprintf(filename, "%s.wav", dimpSoundList[sound - 1]); - in = SearchMan.createReadStreamForMember(filename); - if (!in) + if (!in.open(filename)) error("loadSound: Can't load %s", filename); - uint32 dstSize = in->size(); + uint32 dstSize = in.size(); dst = (byte *)malloc(dstSize); - if (in->read(dst, dstSize) != dstSize) + if (in.read(dst, dstSize) != dstSize) error("loadSound: Read failed"); - delete in; } else if (getFeatures() & GF_ZLIBCOMP) { char filename[15]; |