diff options
author | Vicent Marti | 2008-10-09 17:56:07 +0000 |
---|---|---|
committer | Vicent Marti | 2008-10-09 17:56:07 +0000 |
commit | bb619b457844a9b9f4acc60d08ce730a8f968301 (patch) | |
tree | a2ed5d153f0cf2d3b679801854d444251326b435 | |
parent | ec60fc6db719b318c38b18f4bf23ae55c59f6d61 (diff) | |
download | scummvm-rg350-bb619b457844a9b9f4acc60d08ce730a8f968301.tar.gz scummvm-rg350-bb619b457844a9b9f4acc60d08ce730a8f968301.tar.bz2 scummvm-rg350-bb619b457844a9b9f4acc60d08ce730a8f968301.zip |
- Fixed theme loading from Zip files.
- Changed Common::ZipArchive to use FSNodes instead of full paths (external API unchanged).
svn-id: r34761
-rw-r--r-- | common/unzip.cpp | 12 | ||||
-rw-r--r-- | common/unzip.h | 1 | ||||
-rw-r--r-- | gui/theme.cpp | 3 |
3 files changed, 10 insertions, 6 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp index 9049b000d7..ac0d64df8f 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -79,6 +79,7 @@ #include <zlib.h> #endif +#include "common/fs.h" #include "common/unzip.h" #include "common/file.h" @@ -91,7 +92,6 @@ typedef unzFile__ *unzFile; typedef voidp unzFile; #endif - #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) @@ -487,7 +487,7 @@ static uLong unzlocal_SearchCentralDir(Common::File &fin) { Else, the return value is a unzFile Handle, usable with other function of this unzip package. */ -unzFile unzOpen(const char *path) { +unzFile unzOpen(const Common::FSNode &node) { unz_s *us = new unz_s; uLong central_pos,uL; @@ -501,7 +501,7 @@ unzFile unzOpen(const char *path) { int err=UNZ_OK; - if (!us->file.open(path)) { + if (!us->file.open(node)) { delete us; return NULL; } @@ -1377,7 +1377,11 @@ public: */ ZipArchive::ZipArchive(const Common::String &name) { - _zipFile = unzOpen(name.c_str()); + _zipFile = unzOpen(Common::FSNode(name)); +} + +ZipArchive::ZipArchive(const Common::FSNode &node) { + _zipFile = unzOpen(node); } ZipArchive::~ZipArchive() { diff --git a/common/unzip.h b/common/unzip.h index e6c1863e51..8c9f465b97 100644 --- a/common/unzip.h +++ b/common/unzip.h @@ -39,6 +39,7 @@ class ZipArchive : public Archive { public: ZipArchive(const String &name); + ZipArchive(const Common::FSNode &node); ~ZipArchive(); bool isOpen() const; diff --git a/gui/theme.cpp b/gui/theme.cpp index 3205ee6533..fe4b437863 100644 --- a/gui/theme.cpp +++ b/gui/theme.cpp @@ -137,9 +137,8 @@ bool Theme::themeConfigUseable(const Common::FSNode &node, Common::String &theme bool foundHeader = false; if (node.getName().hasSuffix(".zip")) { - #ifdef USE_ZLIB - Common::ZipArchive zipArchive(node.getPath().c_str()); + Common::ZipArchive zipArchive(node); if (zipArchive.hasFile("THEMERC")) { Common::FilePtr stream(zipArchive.openFile("THEMERC")); stxHeader = stream->readLine(); |