project_files/HedgewarsMobile/SDL-687400b595ab.patch
author Xeli
Tue, 24 Jan 2012 03:38:18 +0100
changeset 6595 f567d52183ec
parent 6409 ca93f38a1aab
permissions -rw-r--r--
add the android support package for Fragments and the like

diff -r 687400b595ab Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
--- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sat Nov 19 19:23:33 2011 -0500
+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sun Nov 20 18:57:07 2011 +0100
@@ -1596,9 +1596,12 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DEBUGGING_SYMBOLS = full;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_THUMB_SUPPORT = NO;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				ONLY_ACTIVE_ARCH = NO;
 				PREBINDING = NO;
 				SDKROOT = iphoneos;
@@ -1613,9 +1616,12 @@
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				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;
 				GCC_WARN_UNUSED_VARIABLE = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				PREBINDING = NO;
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -1630,6 +1636,7 @@
 				DEPLOYMENT_LOCATION = NO;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = SDL_NO_COMPAT;
 				PREBINDING = NO;
 				PRODUCT_NAME = SDL;
 				SKIP_INSTALL = YES;
@@ -1644,6 +1651,7 @@
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEPLOYMENT_LOCATION = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_PREPROCESSOR_DEFINITIONS = SDL_NO_COMPAT;
 				PREBINDING = NO;
 				PRODUCT_NAME = SDL;
 				SKIP_INSTALL = YES;
diff -r 687400b595ab include/SDL_compat.h
--- a/include/SDL_compat.h	Sat Nov 19 19:23:33 2011 -0500
+++ b/include/SDL_compat.h	Sun Nov 20 18:57:07 2011 +0100
@@ -40,7 +40,7 @@
 
  /*@}*/
 
-#ifdef SDL_NO_COMPAT
+#ifndef SDL_NO_COMPAT
 #define _SDL_compat_h
 #endif
 
diff -r 687400b595ab include/SDL_config_iphoneos.h
--- a/include/SDL_config_iphoneos.h	Sat Nov 19 19:23:33 2011 -0500
+++ b/include/SDL_config_iphoneos.h	Sun Nov 20 18:57:07 2011 +0100
@@ -106,7 +106,7 @@
 /* enable iPhone version of Core Audio driver */
 #define SDL_AUDIO_DRIVER_COREAUDIO 1
 /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
-#define SDL_AUDIO_DRIVER_DUMMY	1
+#define SDL_AUDIO_DRIVER_DUMMY	0
 
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 #define SDL_HAPTIC_DISABLED	1
@@ -132,16 +132,16 @@
 /* enable OpenGL ES */
 #define SDL_VIDEO_OPENGL_ES	1
 #define SDL_VIDEO_RENDER_OGL_ES	1
-#define SDL_VIDEO_RENDER_OGL_ES2	1
+#define SDL_VIDEO_RENDER_OGL_ES2	0
 
 /* Enable system power support */
-#define SDL_POWER_UIKIT 1
+#define SDL_POWER_UIKIT 0
 
 /* enable iPhone keyboard support */
 #define SDL_IPHONE_KEYBOARD 1
 
 /* enable joystick subsystem */
-#define SDL_JOYSTICK_DISABLED 0
+#define SDL_JOYSTICK_DISABLED 1
 
 /* Set max recognized G-force from accelerometer
    See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
diff -r 687400b595ab include/SDL_events.h
--- a/include/SDL_events.h	Sat Nov 19 19:23:33 2011 -0500
+++ b/include/SDL_events.h	Sun Nov 20 18:57:07 2011 +0100
@@ -107,11 +107,12 @@
 
     SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
 
+#ifndef SDL_NO_COMPAT
     /* Obsolete events */
     SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
     SDL_EVENT_COMPAT2,
     SDL_EVENT_COMPAT3,
-
+#endif
 
     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
diff -r 687400b595ab src/SDL_compat.c
--- a/src/SDL_compat.c	Sat Nov 19 19:23:33 2011 -0500
+++ b/src/SDL_compat.c	Sun Nov 20 18:57:07 2011 +0100
@@ -29,6 +29,7 @@
 #include "video/SDL_pixels_c.h"
 #include "render/SDL_yuv_sw_c.h"
 
+#ifndef SDL_NO_COMPAT
 
 static SDL_Window *SDL_VideoWindow = NULL;
 static SDL_Surface *SDL_WindowSurface = NULL;
@@ -1813,4 +1814,5 @@
     return 0;
 }
 
+#endif /* SDL_NO_COMPAT */
 /* vi: set ts=4 sw=4 expandtab: */
diff -r 687400b595ab src/video/SDL_surface.c
--- a/src/video/SDL_surface.c	Sat Nov 19 19:23:33 2011 -0500
+++ b/src/video/SDL_surface.c	Sun Nov 20 18:57:07 2011 +0100
@@ -195,12 +195,14 @@
         SDL_InvalidateMap(surface->map);
     }
 
+#ifndef SDL_NO_COMPAT
     /* Compatibility mode */
     if (surface->map->info.flags & SDL_COPY_COLORKEY) {
         surface->flags |= SDL_SRCCOLORKEY;
     } else {
         surface->flags &= ~SDL_SRCCOLORKEY;
     }
+#endif
 
     return 0;
 }
@@ -405,12 +407,14 @@
         SDL_InvalidateMap(surface->map);
     }
 
+#ifndef SDL_NO_COMPAT
     /* Compatibility mode */
     if (surface->map->info.flags & SDL_COPY_BLEND) {
         surface->flags |= SDL_SRCALPHA;
     } else {
         surface->flags &= ~SDL_SRCALPHA;
     }
+#endif
 
     return status;
 }
diff -r 687400b595ab src/video/uikit/SDL_uikitopenglview.m
--- a/src/video/uikit/SDL_uikitopenglview.m	Sat Nov 19 19:23:33 2011 -0500
+++ b/src/video/uikit/SDL_uikitopenglview.m	Sun Nov 20 18:57:07 2011 +0100
@@ -80,7 +80,7 @@
 
         // !!! FIXME: use the screen this is on!
         /* Use the main screen scale (for retina display support) */
-        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+        if ([self respondsToSelector:@selector(contentScaleFactor)])
             self.contentScaleFactor = [UIScreen mainScreen].scale;
 
         /* create the buffers */
diff -r 687400b595ab src/video/uikit/SDL_uikitviewcontroller.m
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Sat Nov 19 19:23:33 2011 -0500
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Sun Nov 20 18:57:07 2011 +0100
@@ -29,9 +29,8 @@
 #include "../../events/SDL_events_c.h"
 
 #include "SDL_uikitwindow.h"
-
-#import "SDL_uikitviewcontroller.h"
-
+#include "SDL_uikitviewcontroller.h"
+#include "SDL_uikitvideo.h"
 
 @implementation SDL_uikitviewcontroller
 
@@ -114,7 +113,11 @@
     const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation];
     SDL_WindowData *data = self->window->driverdata;
     UIWindow *uiwindow = data->uiwindow;
-    UIScreen *uiscreen = [uiwindow screen];
+    UIScreen *uiscreen;
+    if (SDL_UIKit_supports_multiple_displays)
+        uiscreen = [uiwindow screen];
+    else
+        uiscreen = [UIScreen mainScreen];
     const int noborder = (self->window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS));
     CGRect frame = noborder ? [uiscreen bounds] : [uiscreen applicationFrame];
     const CGSize size = frame.size;