|
1 diff -r 687400b595ab Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj |
|
2 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sat Nov 19 19:23:33 2011 -0500 |
|
3 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sun Nov 20 18:57:07 2011 +0100 |
|
4 @@ -1596,9 +1596,12 @@ |
|
5 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
|
6 GCC_C_LANGUAGE_STANDARD = c99; |
|
7 GCC_DEBUGGING_SYMBOLS = full; |
|
8 + GCC_OPTIMIZATION_LEVEL = 0; |
|
9 + GCC_THUMB_SUPPORT = NO; |
|
10 + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; |
|
11 GCC_WARN_ABOUT_RETURN_TYPE = YES; |
|
12 GCC_WARN_UNUSED_VARIABLE = NO; |
|
13 - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; |
|
14 + IPHONEOS_DEPLOYMENT_TARGET = 3.0; |
|
15 ONLY_ACTIVE_ARCH = NO; |
|
16 PREBINDING = NO; |
|
17 SDKROOT = iphoneos; |
|
18 @@ -1613,9 +1616,12 @@ |
|
19 ARCHS = "$(ARCHS_STANDARD_32_BIT)"; |
|
20 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
|
21 GCC_C_LANGUAGE_STANDARD = c99; |
|
22 + GCC_FAST_MATH = YES; |
|
23 + GCC_THUMB_SUPPORT = NO; |
|
24 + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; |
|
25 GCC_WARN_ABOUT_RETURN_TYPE = YES; |
|
26 GCC_WARN_UNUSED_VARIABLE = NO; |
|
27 - IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; |
|
28 + IPHONEOS_DEPLOYMENT_TARGET = 3.0; |
|
29 PREBINDING = NO; |
|
30 SDKROOT = iphoneos; |
|
31 TARGETED_DEVICE_FAMILY = "1,2"; |
|
32 @@ -1630,6 +1636,7 @@ |
|
33 DEPLOYMENT_LOCATION = NO; |
|
34 GCC_DYNAMIC_NO_PIC = NO; |
|
35 GCC_OPTIMIZATION_LEVEL = 0; |
|
36 + GCC_PREPROCESSOR_DEFINITIONS = SDL_NO_COMPAT; |
|
37 PREBINDING = NO; |
|
38 PRODUCT_NAME = SDL; |
|
39 SKIP_INSTALL = YES; |
|
40 @@ -1644,6 +1651,7 @@ |
|
41 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; |
|
42 DEPLOYMENT_LOCATION = NO; |
|
43 GCC_ENABLE_FIX_AND_CONTINUE = NO; |
|
44 + GCC_PREPROCESSOR_DEFINITIONS = SDL_NO_COMPAT; |
|
45 PREBINDING = NO; |
|
46 PRODUCT_NAME = SDL; |
|
47 SKIP_INSTALL = YES; |
|
48 diff -r 687400b595ab include/SDL_compat.h |
|
49 --- a/include/SDL_compat.h Sat Nov 19 19:23:33 2011 -0500 |
|
50 +++ b/include/SDL_compat.h Sun Nov 20 18:57:07 2011 +0100 |
|
51 @@ -40,7 +40,7 @@ |
|
52 |
|
53 /*@}*/ |
|
54 |
|
55 -#ifdef SDL_NO_COMPAT |
|
56 +#ifndef SDL_NO_COMPAT |
|
57 #define _SDL_compat_h |
|
58 #endif |
|
59 |
|
60 diff -r 687400b595ab include/SDL_config_iphoneos.h |
|
61 --- a/include/SDL_config_iphoneos.h Sat Nov 19 19:23:33 2011 -0500 |
|
62 +++ b/include/SDL_config_iphoneos.h Sun Nov 20 18:57:07 2011 +0100 |
|
63 @@ -106,7 +106,7 @@ |
|
64 /* enable iPhone version of Core Audio driver */ |
|
65 #define SDL_AUDIO_DRIVER_COREAUDIO 1 |
|
66 /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ |
|
67 -#define SDL_AUDIO_DRIVER_DUMMY 1 |
|
68 +#define SDL_AUDIO_DRIVER_DUMMY 0 |
|
69 |
|
70 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ |
|
71 #define SDL_HAPTIC_DISABLED 1 |
|
72 @@ -132,16 +132,16 @@ |
|
73 /* enable OpenGL ES */ |
|
74 #define SDL_VIDEO_OPENGL_ES 1 |
|
75 #define SDL_VIDEO_RENDER_OGL_ES 1 |
|
76 -#define SDL_VIDEO_RENDER_OGL_ES2 1 |
|
77 +#define SDL_VIDEO_RENDER_OGL_ES2 0 |
|
78 |
|
79 /* Enable system power support */ |
|
80 -#define SDL_POWER_UIKIT 1 |
|
81 +#define SDL_POWER_UIKIT 0 |
|
82 |
|
83 /* enable iPhone keyboard support */ |
|
84 #define SDL_IPHONE_KEYBOARD 1 |
|
85 |
|
86 /* enable joystick subsystem */ |
|
87 -#define SDL_JOYSTICK_DISABLED 0 |
|
88 +#define SDL_JOYSTICK_DISABLED 1 |
|
89 |
|
90 /* Set max recognized G-force from accelerometer |
|
91 See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed |
|
92 diff -r 687400b595ab include/SDL_events.h |
|
93 --- a/include/SDL_events.h Sat Nov 19 19:23:33 2011 -0500 |
|
94 +++ b/include/SDL_events.h Sun Nov 20 18:57:07 2011 +0100 |
|
95 @@ -107,11 +107,12 @@ |
|
96 |
|
97 SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ |
|
98 |
|
99 +#ifndef SDL_NO_COMPAT |
|
100 /* Obsolete events */ |
|
101 SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */ |
|
102 SDL_EVENT_COMPAT2, |
|
103 SDL_EVENT_COMPAT3, |
|
104 - |
|
105 +#endif |
|
106 |
|
107 /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, |
|
108 * and should be allocated with SDL_RegisterEvents() |
|
109 diff -r 687400b595ab src/SDL_compat.c |
|
110 --- a/src/SDL_compat.c Sat Nov 19 19:23:33 2011 -0500 |
|
111 +++ b/src/SDL_compat.c Sun Nov 20 18:57:07 2011 +0100 |
|
112 @@ -29,6 +29,7 @@ |
|
113 #include "video/SDL_pixels_c.h" |
|
114 #include "render/SDL_yuv_sw_c.h" |
|
115 |
|
116 +#ifndef SDL_NO_COMPAT |
|
117 |
|
118 static SDL_Window *SDL_VideoWindow = NULL; |
|
119 static SDL_Surface *SDL_WindowSurface = NULL; |
|
120 @@ -1813,4 +1814,5 @@ |
|
121 return 0; |
|
122 } |
|
123 |
|
124 +#endif /* SDL_NO_COMPAT */ |
|
125 /* vi: set ts=4 sw=4 expandtab: */ |
|
126 diff -r 687400b595ab src/video/SDL_surface.c |
|
127 --- a/src/video/SDL_surface.c Sat Nov 19 19:23:33 2011 -0500 |
|
128 +++ b/src/video/SDL_surface.c Sun Nov 20 18:57:07 2011 +0100 |
|
129 @@ -195,12 +195,14 @@ |
|
130 SDL_InvalidateMap(surface->map); |
|
131 } |
|
132 |
|
133 +#ifndef SDL_NO_COMPAT |
|
134 /* Compatibility mode */ |
|
135 if (surface->map->info.flags & SDL_COPY_COLORKEY) { |
|
136 surface->flags |= SDL_SRCCOLORKEY; |
|
137 } else { |
|
138 surface->flags &= ~SDL_SRCCOLORKEY; |
|
139 } |
|
140 +#endif |
|
141 |
|
142 return 0; |
|
143 } |
|
144 @@ -405,12 +407,14 @@ |
|
145 SDL_InvalidateMap(surface->map); |
|
146 } |
|
147 |
|
148 +#ifndef SDL_NO_COMPAT |
|
149 /* Compatibility mode */ |
|
150 if (surface->map->info.flags & SDL_COPY_BLEND) { |
|
151 surface->flags |= SDL_SRCALPHA; |
|
152 } else { |
|
153 surface->flags &= ~SDL_SRCALPHA; |
|
154 } |
|
155 +#endif |
|
156 |
|
157 return status; |
|
158 } |
|
159 diff -r 687400b595ab src/video/uikit/SDL_uikitopenglview.m |
|
160 --- a/src/video/uikit/SDL_uikitopenglview.m Sat Nov 19 19:23:33 2011 -0500 |
|
161 +++ b/src/video/uikit/SDL_uikitopenglview.m Sun Nov 20 18:57:07 2011 +0100 |
|
162 @@ -80,7 +80,7 @@ |
|
163 |
|
164 // !!! FIXME: use the screen this is on! |
|
165 /* Use the main screen scale (for retina display support) */ |
|
166 - if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) |
|
167 + if ([self respondsToSelector:@selector(contentScaleFactor)]) |
|
168 self.contentScaleFactor = [UIScreen mainScreen].scale; |
|
169 |
|
170 /* create the buffers */ |
|
171 diff -r 687400b595ab src/video/uikit/SDL_uikitviewcontroller.m |
|
172 --- a/src/video/uikit/SDL_uikitviewcontroller.m Sat Nov 19 19:23:33 2011 -0500 |
|
173 +++ b/src/video/uikit/SDL_uikitviewcontroller.m Sun Nov 20 18:57:07 2011 +0100 |
|
174 @@ -29,9 +29,8 @@ |
|
175 #include "../../events/SDL_events_c.h" |
|
176 |
|
177 #include "SDL_uikitwindow.h" |
|
178 - |
|
179 -#import "SDL_uikitviewcontroller.h" |
|
180 - |
|
181 +#include "SDL_uikitviewcontroller.h" |
|
182 +#include "SDL_uikitvideo.h" |
|
183 |
|
184 @implementation SDL_uikitviewcontroller |
|
185 |
|
186 @@ -114,7 +113,11 @@ |
|
187 const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation]; |
|
188 SDL_WindowData *data = self->window->driverdata; |
|
189 UIWindow *uiwindow = data->uiwindow; |
|
190 - UIScreen *uiscreen = [uiwindow screen]; |
|
191 + UIScreen *uiscreen; |
|
192 + if (SDL_UIKit_supports_multiple_displays) |
|
193 + uiscreen = [uiwindow screen]; |
|
194 + else |
|
195 + uiscreen = [UIScreen mainScreen]; |
|
196 const int noborder = (self->window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)); |
|
197 CGRect frame = noborder ? [uiscreen bounds] : [uiscreen applicationFrame]; |
|
198 const CGSize size = frame.size; |