aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOystein Eftevaag2006-11-08 21:31:47 +0000
committerOystein Eftevaag2006-11-08 21:31:47 +0000
commitff14e19552e7fb1406071c785dbe3fd4cd40b95e (patch)
tree19264c2c4909ee48b8003cd095551f8a903cac89
parenta7950182f50ea16642f437e25b3ed591753edf95 (diff)
downloadscummvm-rg350-ff14e19552e7fb1406071c785dbe3fd4cd40b95e.tar.gz
scummvm-rg350-ff14e19552e7fb1406071c785dbe3fd4cd40b95e.tar.bz2
scummvm-rg350-ff14e19552e7fb1406071c785dbe3fd4cd40b95e.zip
The theme browser will now search through the bundle resource directory on OS X, fixing bug [ 1592294 ] MACOSX: Cannot Switch Back to Modern Theme
svn-id: r24658
-rw-r--r--gui/themebrowser.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp
index 8809ed149a..233220fa34 100644
--- a/gui/themebrowser.cpp
+++ b/gui/themebrowser.cpp
@@ -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 @@ void ThemeBrowser::updateListing() {
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"));