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

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Tue Mar 14 23:44:01 CET 2006


Revision: 21308
Author:   vinterstum
Date:     2006-03-14 23:43:44 -0800 (Tue, 14 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21308&view=rev

Log Message:
-----------
* 'make bundle' now copies the default theme files into the bundle.
* Common::File will now look inside the application bundle on MacOS X for a file if
it can't find it anywhere else (so it'll find default-theme.ini and .zip)
* Cleaned up some #ifs.

Modified Paths:
--------------
    scummvm/trunk/Makefile
    scummvm/trunk/common/file.cpp
    scummvm/trunk/graphics/scaler/hq2x.cpp
    scummvm/trunk/graphics/scaler/hq3x.cpp
    scummvm/trunk/graphics/scaler.cpp
Modified: scummvm/trunk/Makefile
===================================================================
--- scummvm/trunk/Makefile	2006-03-15 06:29:28 UTC (rev 21307)
+++ scummvm/trunk/Makefile	2006-03-15 07:43:44 UTC (rev 21308)
@@ -94,6 +94,8 @@
 	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
 	cp $(srcdir)/dists/macosx/Info.plist $(bundle_name)/Contents/
 	cp $(srcdir)/scummvm.icns $(bundle_name)/Contents/Resources/
+	cp $(srcdir)/gui/themes/default-theme.ini $(bundle_name)/Contents/Resources/
+	cp $(srcdir)/gui/themes/default-theme.zip $(bundle_name)/Contents/Resources/
 	cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
 	$(srcdir)/tools/credits.pl --rtf > $(bundle_name)/Contents/Resources/Credits.rtf
 	strip $(bundle_name)/Contents/MacOS/scummvm

Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp	2006-03-15 06:29:28 UTC (rev 21307)
+++ scummvm/trunk/common/file.cpp	2006-03-15 07:43:44 UTC (rev 21308)
@@ -23,6 +23,10 @@
 #include "common/file.h"
 #include "common/util.h"
 
+#ifdef MACOSX
+#include "CoreFoundation/CoreFoundation.h"
+#endif
+
 namespace Common {
 
 StringList File::_defaultDirectories;
@@ -98,6 +102,24 @@
 	}
 #endif
 
+// If all else fails, try looking inside the application bundle on MacOS for the lowercase file.
+#ifdef MACOSX
+	if (!file) {
+		ptr = buf + offsetToFileName;
+		while (*ptr) {
+			*ptr = tolower(*ptr);
+			ptr++;
+		}
+
+		CFStringRef fileName = CFStringCreateWithBytes(NULL, (const UInt8 *)buf, strlen(buf), kCFStringEncodingASCII, false);
+		CFURLRef fileUrl = CFBundleCopyResourceURL(CFBundleGetMainBundle(), fileName, NULL, NULL);
+		if (fileUrl) {
+			if (CFURLGetFileSystemRepresentation(fileUrl, true, (UInt8 *)buf, sizeof(buf)))
+				file = fopen(buf, mode);
+		}
+	}
+#endif
+
 	return file;
 }
 

Modified: scummvm/trunk/graphics/scaler/hq2x.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/hq2x.cpp	2006-03-15 06:29:28 UTC (rev 21307)
+++ scummvm/trunk/graphics/scaler/hq2x.cpp	2006-03-15 07:43:44 UTC (rev 21308)
@@ -28,11 +28,9 @@
 
 extern "C" {
 
-#ifndef _WIN32
-#ifndef MACOSX
+#if !defined(_WIN32) && !defined(MACOSX)
 #define hq2x_16 _hq2x_16
 #endif
-#endif
 
 void hq2x_16(const byte *, byte *, uint32, uint32, uint32, uint32);
 

Modified: scummvm/trunk/graphics/scaler/hq3x.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/hq3x.cpp	2006-03-15 06:29:28 UTC (rev 21307)
+++ scummvm/trunk/graphics/scaler/hq3x.cpp	2006-03-15 07:43:44 UTC (rev 21308)
@@ -28,12 +28,11 @@
 
 extern "C" {
 
-#ifndef _WIN32
-#ifndef MACOSX
+#if !defined(_WIN32) && !defined(MACOSX)
 #define hq3x_16 _hq3x_16
 #endif
-#endif
 
+
 void hq3x_16(const byte *, byte *, uint32, uint32, uint32, uint32);
 
 }

Modified: scummvm/trunk/graphics/scaler.cpp
===================================================================
--- scummvm/trunk/graphics/scaler.cpp	2006-03-15 06:29:28 UTC (rev 21307)
+++ scummvm/trunk/graphics/scaler.cpp	2006-03-15 07:43:44 UTC (rev 21308)
@@ -36,12 +36,10 @@
 // NOTE: if your compiler uses different mangled names, add another
 //       condition here
 
-#ifndef _WIN32
-#ifndef MACOSX
+#if !defined(_WIN32) && !defined(MACOSX)
 #define RGBtoYUV _RGBtoYUV
 #define LUT16to32 _LUT16to32
 #endif
-#endif
 
 #endif
 


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