From a3b79ca8f6fcf65cf5a913245014c5752c569688 Mon Sep 17 00:00:00 2001 From: Emanuele Disco Date: Sat, 9 Apr 2022 03:30:31 +0900 Subject: [PATCH] - fixed FileSystemSoundFontReader fail to read gus patches. The method open_file use read text flags to open a file and it fail to check the header of the gus patches, by setting the flag to read binary fix the issue. --- source/zmusic/fileio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/zmusic/fileio.h b/source/zmusic/fileio.h index dcea971..87a363d 100644 --- a/source/zmusic/fileio.h +++ b/source/zmusic/fileio.h @@ -320,7 +320,7 @@ public: std::string fullname; if (!fn) { - f = utf8_fopen(mBaseFile.c_str(), "rt"); + f = utf8_fopen(mBaseFile.c_str(), "rb"); fullname = mBaseFile; } else @@ -330,11 +330,11 @@ public: for(int i = (int)mPaths.size()-1; i>=0; i--) { fullname = mPaths[i] + fn; - f = utf8_fopen(fullname.c_str(), "rt"); - break; + f = utf8_fopen(fullname.c_str(), "rb"); + if (f) break; } } - if (!f) f = fopen(fn, "rt"); + if (!f) f = fopen(fn, "rb"); } if (!f) return nullptr; auto tf = new StdioFileReader;