Merge pull request #1400 from walzer/gles20

fix compilation error in xcodebuild command line mode, which are caused by ios6 compatibility
This commit is contained in:
Walzer 2012-09-26 19:29:53 -07:00
commit bfa71ebdf5
9 changed files with 39 additions and 23 deletions

View File

@ -118,18 +118,17 @@
}
size.width = MIN(size.width, origSize.width);
// adjust the point for alignment
switch ((NSTextAlignment)self.textAlignment) {
case NSTextAlignmentLeft:
switch (self.textAlignment) {
case UITextAlignmentLeft:
break;
case NSTextAlignmentCenter:
case UITextAlignmentCenter:
point.x += (origSize.width - size.width) / 2.0f;
break;
case NSTextAlignmentRight:
case UITextAlignmentRight:
point.x += origSize.width - size.width;
break;
case NSTextAlignmentJustified:
case NSTextAlignmentNatural:
default: break;
default:
break;
}
[self.text drawAtPoint:point forWidth:size.width withZFont:actualFont lineBreakMode:self.lineBreakMode];
} else {

View File

@ -637,19 +637,18 @@ static CGSize drawOrSizeTextConstrainedToSize(BOOL performDraw, NSString *string
// draw
if (performDraw) {
switch ((NSTextAlignment)alignment) {
case NSTextAlignmentLeft:
switch (alignment) {
case UITextAlignmentLeft:
drawPoint.x = 0;
break;
case NSTextAlignmentCenter:
case UITextAlignmentCenter:
drawPoint.x = (constrainedSize.width - lineSize.width) / 2.0f;
break;
case NSTextAlignmentRight:
case UITextAlignmentRight:
drawPoint.x = constrainedSize.width - lineSize.width;
break;
case NSTextAlignmentJustified:
case NSTextAlignmentNatural:
default: break;
default:
break;
}
NSUInteger stopGlyphIdx = glyphIdx;
NSUInteger lastRunIdx = currentRunIdx;

View File

@ -57,15 +57,21 @@
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations
{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -42,7 +42,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -42,7 +42,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -42,7 +42,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}
- (BOOL) shouldAutorotate {