aboutsummaryrefslogtreecommitdiff
path: root/sound/mods/module.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-10-19 05:37:22 +0000
committerTravis Howell2006-10-19 05:37:22 +0000
commit8c72861de463e0db36b234750fb19904e5f04d3b (patch)
tree9b8139009ee2510033fc3392f2daab1d8b737e35 /sound/mods/module.cpp
parented3c6871f967ab15321df14ca6a026e08d96fae1 (diff)
downloadscummvm-rg350-8c72861de463e0db36b234750fb19904e5f04d3b.tar.gz
scummvm-rg350-8c72861de463e0db36b234750fb19904e5f04d3b.tar.bz2
scummvm-rg350-8c72861de463e0db36b234750fb19904e5f04d3b.zip
Add option to load a module via stream
svn-id: r24387
Diffstat (limited to 'sound/mods/module.cpp')
-rw-r--r--sound/mods/module.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/mods/module.cpp b/sound/mods/module.cpp
index f7f343fde5..4c20c3a741 100644
--- a/sound/mods/module.cpp
+++ b/sound/mods/module.cpp
@@ -46,6 +46,14 @@ bool Module::load(const char *fn) {
Common::MemoryReadStream st(buf, bufsz);
+ bool result = loadStream(st);
+
+ delete[] buf;
+
+ return result;
+}
+
+bool Module::loadStream(Common::SeekableReadStream &st) {
st.read(songname, 20);
songname[0] = '\0';
@@ -155,8 +163,6 @@ bool Module::load(const char *fn) {
assert(st.eos());
- delete[] buf;
-
return true;
}