use -Os --ffast-math on ios everywhere, plus other sdk3.2 compatibility changes
authorkoda
Fri, 05 Aug 2011 01:22:51 +0200
changeset 5503 d8632f589008
parent 5501 0ba2dca673e6
child 5505 a55aab592950
use -Os --ffast-math on ios everywhere, plus other sdk3.2 compatibility changes
misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj
misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj
misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj
project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m
project_files/HedgewarsMobile/Classes/UIImageExtra.m
--- a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj	Fri Aug 05 14:15:19 2011 -0400
+++ b/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj	Fri Aug 05 01:22:51 2011 +0200
@@ -1115,7 +1115,8 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_OPTIMIZATION_LEVEL = 2;
+				GCC_FAST_MATH = YES;
+				GCC_OPTIMIZATION_LEVEL = s;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					DARWIN_NO_CARBON,
 					FT2_BUILD_LIBRARY,
--- a/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj	Fri Aug 05 14:15:19 2011 -0400
+++ b/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj	Fri Aug 05 01:22:51 2011 +0200
@@ -405,6 +405,7 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_FAST_MATH = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
--- a/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj	Fri Aug 05 14:15:19 2011 -0400
+++ b/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj	Fri Aug 05 01:22:51 2011 +0200
@@ -325,6 +325,7 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_FAST_MATH = YES;
 				GCC_THUMB_SUPPORT = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
--- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Fri Aug 05 14:15:19 2011 -0400
+++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m	Fri Aug 05 01:22:51 2011 +0200
@@ -144,10 +144,9 @@
 -(void) applicationWillResignActive:(UIApplication *)application {
     //[super applicationWillResignActive:application];
 
-    UIDevice* device = [UIDevice currentDevice];
+    UIDevice *device = [UIDevice currentDevice];
     if ([device respondsToSelector:@selector(isMultitaskingSupported)] &&
-         device.multitaskingSupported &&
-         self.isInGame) {
+         [device isMultitaskingSupported] && self.isInGame) {
         // let's try to be permissive with multitasking here...
         if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"multitasking"] boolValue])
             HW_suspend();
@@ -166,10 +165,9 @@
 -(void) applicationDidBecomeActive:(UIApplication *)application {
     //[super applicationDidBecomeActive:application];
 
-    UIDevice* device = [UIDevice currentDevice];
+    UIDevice *device = [UIDevice currentDevice];
     if ([device respondsToSelector:@selector(isMultitaskingSupported)] &&
-         device.multitaskingSupported &&
-         self.isInGame) {
+         [device isMultitaskingSupported] && self.isInGame) {
         HW_resume();
     }
 }
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Fri Aug 05 14:15:19 2011 -0400
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Fri Aug 05 01:22:51 2011 +0200
@@ -25,17 +25,17 @@
 @implementation UIImage (extra)
 
 CGFloat getScreenScale(void) {
+    float scale = 1.0f;
     if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
-        return [UIScreen mainScreen].scale;
-    else
-        return 1.0f;
+        scale = [[UIScreen mainScreen] scale];
+    return scale;
 }
 
 -(UIImage *)scaleToSize:(CGSize) size {
     DLog(@"warning - this is a very expensive operation, you should avoid using it");
 
     // Create a bitmap graphics context; this will also set it as the current context
-    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+    if (UIGraphicsBeginImageContextWithOptions != NULL)
         UIGraphicsBeginImageContextWithOptions(size, NO, getScreenScale());
     else
         UIGraphicsBeginImageContext(size);