mirror of https://github.com/axmolengine/axmol.git
fix compilation error in xcodebuild command line, which are caused by ios6 deprecated marcos and enums
This commit is contained in:
parent
70e16a5835
commit
c9772c76ec
|
@ -118,18 +118,17 @@
|
||||||
}
|
}
|
||||||
size.width = MIN(size.width, origSize.width);
|
size.width = MIN(size.width, origSize.width);
|
||||||
// adjust the point for alignment
|
// adjust the point for alignment
|
||||||
switch ((NSTextAlignment)self.textAlignment) {
|
switch (self.textAlignment) {
|
||||||
case NSTextAlignmentLeft:
|
case UITextAlignmentLeft:
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentCenter:
|
case UITextAlignmentCenter:
|
||||||
point.x += (origSize.width - size.width) / 2.0f;
|
point.x += (origSize.width - size.width) / 2.0f;
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentRight:
|
case UITextAlignmentRight:
|
||||||
point.x += origSize.width - size.width;
|
point.x += origSize.width - size.width;
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentJustified:
|
default:
|
||||||
case NSTextAlignmentNatural:
|
break;
|
||||||
default: break;
|
|
||||||
}
|
}
|
||||||
[self.text drawAtPoint:point forWidth:size.width withZFont:actualFont lineBreakMode:self.lineBreakMode];
|
[self.text drawAtPoint:point forWidth:size.width withZFont:actualFont lineBreakMode:self.lineBreakMode];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -637,19 +637,18 @@ static CGSize drawOrSizeTextConstrainedToSize(BOOL performDraw, NSString *string
|
||||||
|
|
||||||
// draw
|
// draw
|
||||||
if (performDraw) {
|
if (performDraw) {
|
||||||
switch ((NSTextAlignment)alignment) {
|
switch (alignment) {
|
||||||
case NSTextAlignmentLeft:
|
case UITextAlignmentLeft:
|
||||||
drawPoint.x = 0;
|
drawPoint.x = 0;
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentCenter:
|
case UITextAlignmentCenter:
|
||||||
drawPoint.x = (constrainedSize.width - lineSize.width) / 2.0f;
|
drawPoint.x = (constrainedSize.width - lineSize.width) / 2.0f;
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentRight:
|
case UITextAlignmentRight:
|
||||||
drawPoint.x = constrainedSize.width - lineSize.width;
|
drawPoint.x = constrainedSize.width - lineSize.width;
|
||||||
break;
|
break;
|
||||||
case NSTextAlignmentJustified:
|
default:
|
||||||
case NSTextAlignmentNatural:
|
break;
|
||||||
default: break;
|
|
||||||
}
|
}
|
||||||
NSUInteger stopGlyphIdx = glyphIdx;
|
NSUInteger stopGlyphIdx = glyphIdx;
|
||||||
NSUInteger lastRunIdx = currentRunIdx;
|
NSUInteger lastRunIdx = currentRunIdx;
|
||||||
|
|
|
@ -57,15 +57,21 @@
|
||||||
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
|
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
|
||||||
}
|
}
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations
|
||||||
|
{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void)didReceiveMemoryWarning {
|
- (void)didReceiveMemoryWarning {
|
||||||
// Releases the view if it doesn't have a superview.
|
// Releases the view if it doesn't have a superview.
|
||||||
[super didReceiveMemoryWarning];
|
[super didReceiveMemoryWarning];
|
||||||
|
|
|
@ -59,7 +59,9 @@
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
|
|
|
@ -59,7 +59,9 @@
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
|
|
|
@ -42,7 +42,9 @@
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
|
|
|
@ -42,7 +42,9 @@
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
|
|
|
@ -59,7 +59,9 @@
|
||||||
|
|
||||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||||
- (NSUInteger) supportedInterfaceOrientations{
|
- (NSUInteger) supportedInterfaceOrientations{
|
||||||
|
#ifdef __IPHONE_6_0
|
||||||
return UIInterfaceOrientationMaskLandscape;
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) shouldAutorotate {
|
- (BOOL) shouldAutorotate {
|
||||||
|
|
Loading…
Reference in New Issue