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 /common | |
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
Diffstat (limited to 'common')
-rw-r--r-- | common/unzip.cpp | 12 | ||||
-rw-r--r-- | common/unzip.h | 1 |
2 files changed, 9 insertions, 4 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; |