[Scummvm-cvs-logs] SF.net SVN: scummvm: [24658] scummvm/trunk/gui/themebrowser.cpp

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Wed Nov 8 22:31:51 CET 2006


Revision: 24658
          http://svn.sourceforge.net/scummvm/?rev=24658&view=rev
Author:   vinterstum
Date:     2006-11-08 13:31:47 -0800 (Wed, 08 Nov 2006)

Log Message:
-----------
The theme browser will now search through the bundle resource directory on OS X, fixing bug [ 1592294 ] MACOSX: Cannot Switch Back to Modern Theme

Modified Paths:
--------------
    scummvm/trunk/gui/themebrowser.cpp

Modified: scummvm/trunk/gui/themebrowser.cpp
===================================================================
--- scummvm/trunk/gui/themebrowser.cpp	2006-11-08 18:47:33 UTC (rev 24657)
+++ scummvm/trunk/gui/themebrowser.cpp	2006-11-08 21:31:47 UTC (rev 24658)
@@ -26,6 +26,10 @@
 #include "gui/theme.h"
 #include "common/fs.h"
 
+#ifdef MACOSX
+#include "CoreFoundation/CoreFoundation.h"
+#endif
+
 namespace GUI {
 
 enum {
@@ -102,6 +106,18 @@
 	addDir(_themes, DATA_PATH);
 #endif
 
+#ifdef MACOSX
+    CFURLRef resourceUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
+    if (resourceUrl) {
+		char buf[256];
+		if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) {
+			Common::String resourcePath = buf;
+			addDir(_themes, resourcePath, 0);
+		}
+	    CFRelease(resourceUrl);
+    }
+#endif
+
 	if (ConfMan.hasKey("extrapath"))
 		addDir(_themes, ConfMan.get("extrapath"));
 


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