[Scummvm-cvs-logs] SF.net SVN: scummvm:[34761] scummvm/trunk
tanoku at users.sourceforge.net
tanoku at users.sourceforge.net
Thu Oct 9 19:56:07 CEST 2008
Revision: 34761
http://scummvm.svn.sourceforge.net/scummvm/?rev=34761&view=rev
Author: tanoku
Date: 2008-10-09 17:56:07 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
- Fixed theme loading from Zip files.
- Changed Common::ZipArchive to use FSNodes instead of full paths (external API unchanged).
Modified Paths:
--------------
scummvm/trunk/common/unzip.cpp
scummvm/trunk/common/unzip.h
scummvm/trunk/gui/theme.cpp
Modified: scummvm/trunk/common/unzip.cpp
===================================================================
--- scummvm/trunk/common/unzip.cpp 2008-10-09 17:15:10 UTC (rev 34760)
+++ scummvm/trunk/common/unzip.cpp 2008-10-09 17:56:07 UTC (rev 34761)
@@ -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 voidp unzFile;
#endif
-
#define UNZ_OK (0)
#define UNZ_END_OF_LIST_OF_FILE (-100)
#define UNZ_ERRNO (Z_ERRNO)
@@ -487,7 +487,7 @@
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 @@
int err=UNZ_OK;
- if (!us->file.open(path)) {
+ if (!us->file.open(node)) {
delete us;
return NULL;
}
@@ -1377,9 +1377,13 @@
*/
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() {
unzClose(_zipFile);
}
Modified: scummvm/trunk/common/unzip.h
===================================================================
--- scummvm/trunk/common/unzip.h 2008-10-09 17:15:10 UTC (rev 34760)
+++ scummvm/trunk/common/unzip.h 2008-10-09 17:56:07 UTC (rev 34761)
@@ -39,6 +39,7 @@
public:
ZipArchive(const String &name);
+ ZipArchive(const Common::FSNode &node);
~ZipArchive();
bool isOpen() const;
Modified: scummvm/trunk/gui/theme.cpp
===================================================================
--- scummvm/trunk/gui/theme.cpp 2008-10-09 17:15:10 UTC (rev 34760)
+++ scummvm/trunk/gui/theme.cpp 2008-10-09 17:56:07 UTC (rev 34761)
@@ -137,9 +137,8 @@
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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list