aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie
diff options
context:
space:
mode:
authorScott Thomas2011-04-08 21:04:51 +0930
committerScott Thomas2011-04-08 21:08:47 +0930
commit5c4d7baa06530cb17d7fdf91eb1c93d62274827a (patch)
tree4e7ed1076a52fec1b28f8231441a7aadef44930d /engines/groovie
parentc44b509b053ddd8a9d1cd63056058adc8b54b1cf (diff)
downloadscummvm-rg350-5c4d7baa06530cb17d7fdf91eb1c93d62274827a.tar.gz
scummvm-rg350-5c4d7baa06530cb17d7fdf91eb1c93d62274827a.tar.bz2
scummvm-rg350-5c4d7baa06530cb17d7fdf91eb1c93d62274827a.zip
GROOVIE: Determine correct MPEG4 resource to load for based on fileref
Diffstat (limited to 'engines/groovie')
-rw-r--r--engines/groovie/music.cpp17
-rw-r--r--engines/groovie/resource.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index e02125c192..bc8131379b 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -761,13 +761,24 @@ bool MusicPlayerMPEG4::load(uint32 fileref, bool loop) {
// Stop any old sound
_vm->_system->getMixer()->stopHandle(_handle);
+ // Find the filename
+ ResInfo info;
+ _vm->_resMan->getResInfo(fileref, info);
+ uint len = info.filename.size();
+ if (len < 4)
+ return false; // This shouldn't actually occur
+
+ // RL still says xmi, but we're after external m4a
+ info.filename.setChar('m', len-3);
+ info.filename.setChar('4', len-2);
+ info.filename.setChar('a', len-1);
+
// Create the audio stream
- Common::String filename = Common::String::format("gu%d.m4a", fileref & 0x3FF);
- Audio::AudioStream *audStream = Audio::makeQuickTimeStream(filename);
+ Audio::AudioStream *audStream = Audio::makeQuickTimeStream(info.filename);
if (!audStream) {
// MPEG-4 sounds aren't handled yet, so nothing should play here yet
- warning("Could not play MPEG-4 sound '%s'", filename.c_str());
+ warning("Could not play MPEG-4 sound '%s'", info.filename.c_str());
return false;
}
diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h
index 798bbf4b5b..c87658999a 100644
--- a/engines/groovie/resource.h
+++ b/engines/groovie/resource.h
@@ -45,10 +45,10 @@ public:
Common::SeekableReadStream *open(uint32 fileRef);
virtual uint16 getRef(Common::String name, Common::String scriptname = "") = 0;
+ virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0;
protected:
Common::Array<Common::String> _gjds;
- virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0;
uint16 _lastGjd;
};