From 9756a420a3629900783c63f1bc4778c08e2c969b Mon Sep 17 00:00:00 2001 From: James Brown Date: Sun, 11 Jul 2004 04:41:48 +0000 Subject: Use extrapath in Sword1 engine (from 0.6.0 branch). More verbose errors to go with the forthcoming new manual. Sword1 CD swapping doesn't work as expected HERE, either :) svn-id: r14188 --- sound/audiostream.cpp | 7 +++++-- sound/audiostream.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index ee86fd9c30..d61f572f34 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -67,7 +67,7 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = { { NULL, NULL, NULL } // Terminator }; -AudioStream* AudioStream::openStreamFile(const char* filename) +AudioStream* AudioStream::openStreamFile(const char* filename, const char *path) { char buffer[1024]; const uint len = strlen(filename); @@ -82,7 +82,10 @@ AudioStream* AudioStream::openStreamFile(const char* filename) for (int i = 0; i < ARRAYSIZE(STREAM_FILEFORMATS)-1 && stream == NULL; ++i) { strcpy(ext, STREAM_FILEFORMATS[i].fileExtension); - fileHandle->open(buffer); + if (path != NULL) + fileHandle->open(buffer, File::kFileReadMode, path); + else + fileHandle->open(buffer); if (fileHandle->isOpen()) stream = STREAM_FILEFORMATS[i].openStreamFile(fileHandle, fileHandle->size()); } diff --git a/sound/audiostream.h b/sound/audiostream.h index ac456233ba..bd39c04c2b 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -86,7 +86,7 @@ public: * @return an Audiostream ready to use in case of success; * NULL in case of an error (e.g. invalid/nonexisting file) */ - static AudioStream* openStreamFile(const char* filename); + static AudioStream* openStreamFile(const char* filename, const char* path=NULL); }; class AppendableAudioStream : public AudioStream { -- cgit v1.2.3