Skip to content

Commit

Permalink
Improved compatibility with OS X 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
daylen committed Apr 9, 2014
1 parent 77608a1 commit 3305ba9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Stockfish.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SDKROOT = macosx10.8;
};
name = Debug;
};
Expand Down Expand Up @@ -735,8 +735,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
SDKROOT = macosx;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx10.8;
};
name = Release;
};
Expand Down Expand Up @@ -849,9 +849,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SDKROOT = macosx10.8;
};
name = Test;
};
Expand Down
2 changes: 1 addition & 1 deletion Stockfish/SFMArrowView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (void)drawRect:(NSRect)dirtyRect
return;
}

[[NSColor colorWithRed:1 green:0 blue:0 alpha:0.5] set];
[[NSColor colorWithSRGBRed:1 green:0 blue:0 alpha:0.5] set];

CGFloat arrowLineWidth = self.squareSideLength * ARROW_LINE_WIDTH_AS_PERCENT_OF_SQUARE_WIDTH;

Expand Down
4 changes: 2 additions & 2 deletions Stockfish/SFMBoardView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ - (id)initWithFrame:(NSRect)frame
self.lightSquareColor = [NSColor whiteColor];
self.darkSquareColor = [NSColor brownColor];
self.fontColor = [NSColor whiteColor];
self.highlightColor = [NSColor colorWithRed:1 green:1 blue:0 alpha:0.7];
self.highlightColor = [NSColor colorWithSRGBRed:1 green:1 blue:0 alpha:0.7];

self.boardShadow = [NSShadow new];
[self.boardShadow setShadowBlurRadius:BOARD_SHADOW_BLUR_RADIUS];
[self.boardShadow setShadowColor:[NSColor colorWithWhite:0 alpha:0.75]]; // Gray
[self.boardShadow setShadowColor:[NSColor colorWithGenericGamma22White:0 alpha:0.75]]; // Gray

self.position = new Position([FEN_START_POSITION UTF8String]);

Expand Down
2 changes: 1 addition & 1 deletion Stockfish/SFMChessGame.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ - (id)initWithWhite:(SFMPlayer *)p1 andBlack:(SFMPlayer *)p2
{
self = [super init];
if (self) {
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSCalendarUnitYear|NSCalendarUnitDay|NSCalendarUnitMonth fromDate:[NSDate new]];
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:kCFCalendarUnitYear|kCFCalendarUnitDay|kCFCalendarUnitMonth fromDate:[NSDate new]];
NSString *dateStr = [NSString stringWithFormat:@"%ld.%02ld.%02ld", (long)dateComponents.year, (long)dateComponents.month, (long)dateComponents.day];
NSDictionary *defaultTags = @{@"Event": @"Casual Game",
@"Site": @"Earth",
Expand Down
2 changes: 1 addition & 1 deletion Stockfish/SFMPieceView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (id)initWithPieceType:(Chess::Piece)pieceType

NSShadow *shadow = [NSShadow new];
[shadow setShadowBlurRadius:PIECE_SHADOW_BLUR_RADIUS];
[shadow setShadowColor:[NSColor colorWithWhite:0 alpha:0.5]]; // Gray
[shadow setShadowColor:[NSColor colorWithGenericGamma22White:0 alpha:0.5]]; // Gray
[self setShadow:shadow];
}
return self;
Expand Down
6 changes: 3 additions & 3 deletions Stockfish/SFMWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ - (void)checkIfGameOver
if (self.currentGame.currPosition->is_mate()) {
NSString *resultText = (self.currentGame.currPosition->side_to_move() == WHITE) ? @"0-1" : @"1-0";
NSAlert *alert = [NSAlert alertWithMessageText:@"Game over!" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:(self.currentGame.currPosition->side_to_move() == WHITE) ? @"Black wins." : @"White wins."];
[alert beginSheetModalForWindow:self.window completionHandler:nil];
[alert beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil];
self.currentGame.tags[@"Result"] = resultText;
} else if (self.currentGame.currPosition->is_immediate_draw()) {
NSAlert *alert = [NSAlert alertWithMessageText:@"Game over!" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"It's a draw."];
[alert beginSheetModalForWindow:self.window completionHandler:nil];
[alert beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil];
self.currentGame.tags[@"Result"] = @"1/2-1/2";
}
}
Expand Down Expand Up @@ -431,7 +431,7 @@ - (NSString *)prettyPV:(NSString *)pvAsText
}

// And now, we add the arrow to the board
Move firstMove = ((SFMChessMove *)[pvMacMoveObjects firstObject]).move;
Move firstMove = ((SFMChessMove *) pvMacMoveObjects[0]).move;
[self.boardView clearArrows];
[self.boardView addArrowFrom:move_from(firstMove) to:move_to(firstMove)];

Expand Down
4 changes: 2 additions & 2 deletions Stockfish/Stockfish-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<string>1.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>13</string>
<string>14</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.board-games</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Binary file modified Stockfish/stockfish-64
Binary file not shown.
Binary file modified Stockfish/stockfish-sse42
Binary file not shown.

0 comments on commit 3305ba9

Please sign in to comment.