diff options
author | Max Horn | 2008-09-30 12:37:28 +0000 |
---|---|---|
committer | Max Horn | 2008-09-30 12:37:28 +0000 |
commit | 50396dda70076f37801066a23c6ab37ecd6c3975 (patch) | |
tree | 37260c0318624df1848495c5f7bae28f0378784d /gui | |
parent | 9b160804ab8878b55efb032fb62ee359ab97f848 (diff) | |
download | scummvm-rg350-50396dda70076f37801066a23c6ab37ecd6c3975.tar.gz scummvm-rg350-50396dda70076f37801066a23c6ab37ecd6c3975.tar.bz2 scummvm-rg350-50396dda70076f37801066a23c6ab37ecd6c3975.zip |
cleanup
svn-id: r34701
Diffstat (limited to 'gui')
-rw-r--r-- | gui/theme.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gui/theme.cpp b/gui/theme.cpp index 8928d2f467..39dedd3875 100644 --- a/gui/theme.cpp +++ b/gui/theme.cpp @@ -71,9 +71,10 @@ const Graphics::Font *Theme::loadFont(const char *filename) { #ifdef USE_ZLIB Common::ZipArchive zipArchive(_stylefile + ".zip"); - if (zipArchive.hasFile(cacheFilename)) { - Common::FilePtr stream(zipArchive.openFile(cacheFilename)); - font = Graphics::NewFont::loadFromCache(*stream.get()); + Common::SeekableReadStream *stream(zipArchive.openFile(cacheFilename)); + if (stream) { + font = Graphics::NewFont::loadFromCache(*stream); + delete stream; } #endif if (font) @@ -88,9 +89,10 @@ const Graphics::Font *Theme::loadFont(const char *filename) { #ifdef USE_ZLIB if (!font) { Common::ZipArchive zipArchive(_stylefile + ".zip"); - if (zipArchive.hasFile(filename)) { - Common::FilePtr stream(zipArchive.openFile(filename)); - font = Graphics::NewFont::loadFont(*stream.get()); + Common::SeekableReadStream *stream(zipArchive.openFile(filename)); + if (stream) { + font = Graphics::NewFont::loadFont(*stream); + delete stream; } } #endif @@ -139,10 +141,9 @@ bool Theme::loadConfigFile(const Common::String &stylefile) { #ifdef USE_ZLIB // Maybe find a nicer solution to this Common::ZipArchive zipArchive(stylefile + ".zip"); - if (zipArchive.hasFile(stylefile + ".ini")) { - Common::FilePtr stream(zipArchive.openFile(stylefile + ".ini")); - if (_configFile.loadFromStream(*stream.get())) - return true; + Common::File file; + if (file.open(stylefile + ".ini", zipArchive)) { + return _configFile.loadFromStream(file); } #endif |