aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/mt32/synth.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-12-08 01:35:12 +0000
committerJohannes Schickel2010-12-08 01:35:12 +0000
commitd451084fb44a536d0f161bccb5b73088df253c9c (patch)
treec3a7b31db380016a5b1734668b955116be937973 /sound/softsynth/mt32/synth.cpp
parent08262d90fb214f292aacf2b927ecb39fe50aef66 (diff)
downloadscummvm-rg350-d451084fb44a536d0f161bccb5b73088df253c9c.tar.gz
scummvm-rg350-d451084fb44a536d0f161bccb5b73088df253c9c.tar.bz2
scummvm-rg350-d451084fb44a536d0f161bccb5b73088df253c9c.zip
MT32: Get rid of ANSIFile.
svn-id: r54827
Diffstat (limited to 'sound/softsynth/mt32/synth.cpp')
-rw-r--r--sound/softsynth/mt32/synth.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp
index 6a16db22ec..8cf2233654 100644
--- a/sound/softsynth/mt32/synth.cpp
+++ b/sound/softsynth/mt32/synth.cpp
@@ -162,21 +162,11 @@ void Synth::initReverb(Bit8u newRevMode, Bit8u newRevTime, Bit8u newRevLevel) {
}
File *Synth::openFile(const char *filename, File::OpenMode mode) {
- if (myProp.openFile != NULL) {
- return myProp.openFile(myProp.userData, filename, mode);
- }
- char pathBuf[2048];
- if (myProp.baseDir != NULL) {
- strcpy(&pathBuf[0], myProp.baseDir);
- strcat(&pathBuf[0], filename);
- filename = pathBuf;
- }
- ANSIFile *file = new ANSIFile();
- if (!file->open(filename, mode)) {
- delete file;
- return NULL;
- }
- return file;
+ // It should never happen that openFile is NULL in our use case.
+ // Just to cover the case where something is horrible wrong we
+ // use an assert here.
+ assert(myProp.openFile != NULL);
+ return myProp.openFile(myProp.userData, filename, mode);
}
void Synth::closeFile(File *file) {