[Scummvm-cvs-logs] SF.net SVN: scummvm:[33917] scummvm/branches/gsoc2008-gui/gui/ThemeRenderer .cpp
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Fri Aug 15 23:01:33 CEST 2008
Revision: 33917
http://scummvm.svn.sourceforge.net/scummvm/?rev=33917&view=rev
Author: Tanoku
Date: 2008-08-15 21:01:32 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Directory theme opening - WIP.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-08-15 21:00:54 UTC (rev 33916)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-08-15 21:01:32 UTC (rev 33917)
@@ -428,11 +428,12 @@
assert(_parser);
_themeName.clear();
-#ifdef USE_ZLIB
- unzFile zipFile = unzOpen(themeName.c_str());
char fileNameBuffer[32];
int parseCount = 0;
+#ifdef USE_ZLIB
+ unzFile zipFile = unzOpen(themeName.c_str());
+
if (zipFile && unzGoToFirstFile(zipFile) == UNZ_OK) {
while (true) {
unz_file_info fileInfo;
@@ -462,7 +463,6 @@
if (parser()->loadStream(stream) == false || parser()->parse() == false) {
warning("Failed to load stream for zipped file '%s'", fileNameBuffer);
unzClose(zipFile);
-// delete stream;
return false;
}
}
@@ -473,16 +473,34 @@
if (unzGoToNextFile(zipFile) != UNZ_OK)
break;
}
+ } else {
+#endif
+ FilesystemNode node(themeName);
+ if (node.exists() && node.isReadable() && node.isDirectory()) {
+
+ FSList fslist;
+ if (!node.getChildren(fslist, FilesystemNode::kListFilesOnly))
+ return false;
+
+ for (FSList::const_iterator i = fslist.begin(); i != fslist.end(); ++i) {
+ if (i->getName().hasSuffix(".stx")) {
+
+ } else if (i->getName() == "THEMERC") {
+
+ }
+
+ }
+
+ }
+#ifdef USE_ZLIB
}
-// FilesystemNode dir(themeName);
-// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
+ unzClose(zipFile);
- unzClose(zipFile);
+#endif
+
+
return (parseCount > 0 && _themeName.empty() == false);
-#else
- return false;
-#endif
}
bool ThemeRenderer::isWidgetCached(DrawData type, const Common::Rect &r) {
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