From bb619b457844a9b9f4acc60d08ce730a8f968301 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 9 Oct 2008 17:56:07 +0000 Subject: - Fixed theme loading from Zip files. - Changed Common::ZipArchive to use FSNodes instead of full paths (external API unchanged). svn-id: r34761 --- common/unzip.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'common/unzip.cpp') 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 #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() { -- cgit v1.2.3