Mac scr: revert to using Objective-C Garbage Collection instead of Automatic Reference Counting, for compatibility with OS 10.6 and OS 10.7, which require GC in screensavers. It is still compatible with OS 10.8 through OS 10.11. This requires building with Xcode 5 or earlier, because Xcode 6 forces converting to ARC.

This commit is contained in:
Charlie Fenton 2015-09-11 18:46:43 -07:00
parent 51dc2c32f5
commit 8ce413fa31
2 changed files with 15 additions and 10 deletions

View File

@ -53,6 +53,7 @@ int gBlankingTime; // Delay in minutes before blanking the screen
NSString *gPathToBundleResources = NULL;
NSString *mBundleID = NULL; // our bundle ID
NSImage *gBOINC_Logo = NULL;
NSImage *gPreview_Image = NULL;
int gTopWindowListIndex = -1;
@ -253,12 +254,16 @@ int signof(float x) {
if ([ self isPreview ]) {
#if 1 // Currently drawRect just draws our logo in the preview window
NSString *fileName = [[ NSBundle bundleForClass:[ self class ]] pathForImageResource:@"boinc" ];
if (fileName) {
NSImage *myImage = [[ NSImage alloc ] initWithContentsOfFile:fileName ];
[ myImage setScalesWhenResized:YES ];
[ myImage setSize:theFrame.size ];
[ myImage drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 ];
if (gPreview_Image == NULL) {
NSString *fileName = [[ NSBundle bundleForClass:[ self class ]] pathForImageResource:@"boinc" ];
if (fileName) {
gPreview_Image = [[ NSImage alloc ] initWithContentsOfFile:fileName ];
}
}
if (gPreview_Image) {
[ gPreview_Image setScalesWhenResized:YES ];
[ gPreview_Image setSize:theFrame.size ];
[ gPreview_Image drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 ];
}
[ self setAnimationTimeInterval:1/1.0 ];
#else // Code for possible future use if we want to draw more in preview

View File

@ -3863,8 +3863,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
GCC_ENABLE_OBJC_GC = unsupported;
CLANG_ENABLE_OBJC_ARC = NO;
GCC_ENABLE_OBJC_GC = supported;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ScreenSaver-Info.plist";
OTHER_LDFLAGS = (
@ -4035,8 +4035,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
GCC_ENABLE_OBJC_GC = unsupported;
CLANG_ENABLE_OBJC_ARC = NO;
GCC_ENABLE_OBJC_GC = supported;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ScreenSaver-Info.plist";
OTHER_LDFLAGS = (