aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-08-15 21:01:32 +0000
committerVicent Marti2008-08-15 21:01:32 +0000
commit2ae7dc0e32342a0b770bc67883f9b5b77967cb71 (patch)
tree74fa09d37abf643f416ba0cb643f131ac8bdfd36
parent7c213ab11022ffce603099fe409d44d383ce94e7 (diff)
downloadscummvm-rg350-2ae7dc0e32342a0b770bc67883f9b5b77967cb71.tar.gz
scummvm-rg350-2ae7dc0e32342a0b770bc67883f9b5b77967cb71.tar.bz2
scummvm-rg350-2ae7dc0e32342a0b770bc67883f9b5b77967cb71.zip
Directory theme opening - WIP.
svn-id: r33917
-rw-r--r--gui/ThemeRenderer.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp
index c24f8a6d50..5f12cf3fd4 100644
--- a/gui/ThemeRenderer.cpp
+++ b/gui/ThemeRenderer.cpp
@@ -428,11 +428,12 @@ bool ThemeRenderer::loadThemeXML(Common::String themeName) {
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 @@ bool ThemeRenderer::loadThemeXML(Common::String themeName) {
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 @@ bool ThemeRenderer::loadThemeXML(Common::String themeName) {
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);
- return (parseCount > 0 && _themeName.empty() == false);
-#else
- return false;
+
#endif
+
+
+ return (parseCount > 0 && _themeName.empty() == false);
}
bool ThemeRenderer::isWidgetCached(DrawData type, const Common::Rect &r) {