[Scummvm-cvs-logs] SF.net SVN: scummvm:[35133] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Nov 20 19:25:22 CET 2008


Revision: 35133
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35133&view=rev
Author:   lordhoto
Date:     2008-11-20 18:25:22 +0000 (Thu, 20 Nov 2008)

Log Message:
-----------
Fixed ZipArchive/FSDirectory creation.

Modified Paths:
--------------
    scummvm/trunk/graphics/imageman.cpp
    scummvm/trunk/gui/ThemeEngine.cpp

Modified: scummvm/trunk/graphics/imageman.cpp
===================================================================
--- scummvm/trunk/graphics/imageman.cpp	2008-11-20 13:51:42 UTC (rev 35132)
+++ scummvm/trunk/graphics/imageman.cpp	2008-11-20 18:25:22 UTC (rev 35133)
@@ -47,10 +47,11 @@
 
 bool ImageManager::addArchive(const Common::String &name) {
 	Common::Archive *arch = 0;
+	Common::FSNode node(name);
 
-	if (name.hasSuffix(".zip")) {
+	if (node.getName().hasSuffix(".zip")) {
 #ifdef USE_ZLIB
-		Common::ZipArchive *zip = new Common::ZipArchive(name);
+		Common::ZipArchive *zip = new Common::ZipArchive(node);
 		if (!zip || !zip->isOpen())
 			return false;
 
@@ -59,7 +60,7 @@
 		return false;
 #endif
 	} else {
-		Common::FSDirectory *dir = new Common::FSDirectory(name);
+		Common::FSDirectory *dir = new Common::FSDirectory(node);
 		if (!dir || !dir->getFSNode().isDirectory())	
 			return false;
 

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2008-11-20 13:51:42 UTC (rev 35132)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2008-11-20 18:25:22 UTC (rev 35133)
@@ -398,9 +398,8 @@
 }
 
 bool ThemeEngine::addBitmap(const Common::String &filename) {
-	if (_bitmaps.contains(filename)) {
+	if (_bitmaps.contains(filename))
 		ImageMan.unregisterSurface(filename);
-	}
 
 	ImageMan.registerSurface(filename, 0);
 	_bitmaps[filename] = ImageMan.getSurface(filename);
@@ -1070,9 +1069,11 @@
 	Common::Archive *arch = 0;
 	const Graphics::NewFont *font = 0;
 
-	if (getThemeFileName().hasSuffix(".zip")) {
+	Common::FSNode node(getThemeFileName());
+
+	if (node.getName().hasSuffix(".zip")) {
 #ifdef USE_ZLIB
-		Common::ZipArchive *zip = new Common::ZipArchive(getThemeFileName());
+		Common::ZipArchive *zip = new Common::ZipArchive(node);
 		if (!zip || !zip->isOpen())
 			return 0;
 
@@ -1081,7 +1082,7 @@
 		return 0;
 #endif
 	} else {
-		Common::FSDirectory *dir = new Common::FSDirectory(getThemeFileName());
+		Common::FSDirectory *dir = new Common::FSDirectory(node);
 		if (!dir || !dir->getFSNode().isDirectory())	
 			return 0;
 


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