diff --git a/GeekGameBoard-iPhone.xcodeproj/project.pbxproj b/GeekGameBoard-iPhone.xcodeproj/project.pbxproj index e781f37..d7e18e8 100755 --- a/GeekGameBoard-iPhone.xcodeproj/project.pbxproj +++ b/GeekGameBoard-iPhone.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -385,8 +385,11 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GeekGameBoard-iPhone" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -511,13 +514,22 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jens Alfke"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; @@ -529,13 +541,22 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jens Alfke"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; SDKROOT = iphoneos; diff --git a/Source/GGBTextLayer.m b/Source/GGBTextLayer.m index 28632a5..cb533a6 100644 --- a/Source/GGBTextLayer.m +++ b/Source/GGBTextLayer.m @@ -138,7 +138,7 @@ - (void)drawInContext:(CGContextRef)ctx if( _foregroundColor ) CGContextSetFillColorWithColor(ctx, _foregroundColor); - UITextAlignment align; + NSTextAlignment align; if( [_alignmentMode isEqualToString: @"center"] ) align = NSTextAlignmentCenter; else if( [_alignmentMode isEqualToString: @"right"] ) @@ -147,13 +147,14 @@ - (void)drawInContext:(CGContextRef)ctx align = NSTextAlignmentLeft; CGRect bounds = self.bounds; - //float ascender=_font.ascender, descender=_font.descender, leading=_font.leading; - //bounds.size.height -= ascender-descender - leading; - [_string drawInRect: bounds - withFont: _font - lineBreakMode: NSLineBreakByClipping - alignment: align]; + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; + paragraphStyle.lineBreakMode = NSLineBreakByClipping; + paragraphStyle.alignment = align; + + NSDictionary *dictionary = @{NSFontAttributeName:_font, NSParagraphStyleAttributeName:paragraphStyle}; + + [_string drawInRect:bounds withAttributes:dictionary]; UIGraphicsPopContext(); CGContextRestoreGState(ctx); diff --git a/Source/QuartzUtils.m b/Source/QuartzUtils.m index e520b8e..46d5026 100644 --- a/Source/QuartzUtils.m +++ b/Source/QuartzUtils.m @@ -263,7 +263,7 @@ float GetPixelAlpha( CGImageRef image, CGSize imageSize, CGPoint pt ) sTinyContext = CGBitmapContextCreate(sPixel, 1, 1, 8, 1, // bpp, rowBytes NULL, - kCGImageAlphaOnly); + (CGBitmapInfo)kCGImageAlphaOnly); CGContextSetBlendMode(sTinyContext, kCGBlendModeCopy); }