project_files/HedgewarsMobile/SDL.patch
changeset 4933 86bd82d58a0b
parent 4773 69f8431a5d20
child 4934 727da72f754a
equal deleted inserted replaced
4932:f11d80bac7ed 4933:86bd82d58a0b
     1 diff -r f2c2f0ecba5f Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
     1 diff -r 1fbe1c202501 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
     2 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sun Jan 30 13:42:05 2011 -0800
     2 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 10:40:21 2011 -0800
     3 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Jan 31 23:57:58 2011 +0100
     3 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 23:10:55 2011 +0100
     4 @@ -1564,11 +1564,15 @@
     4 @@ -1603,11 +1603,15 @@
     5  			isa = XCBuildConfiguration;
     5  			isa = XCBuildConfiguration;
     6  			buildSettings = {
     6  			buildSettings = {
     7  				ALWAYS_SEARCH_USER_PATHS = NO;
     7  				ALWAYS_SEARCH_USER_PATHS = NO;
     8 +				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
     8 +				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
     9  				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
     9  				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
    15  				GCC_WARN_UNUSED_VARIABLE = NO;
    15  				GCC_WARN_UNUSED_VARIABLE = NO;
    16 +				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\"";
    16 +				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\"";
    17  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
    17  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
    18  				ONLY_ACTIVE_ARCH = NO;
    18  				ONLY_ACTIVE_ARCH = NO;
    19  				PREBINDING = NO;
    19  				PREBINDING = NO;
    20 @@ -1581,12 +1585,18 @@
    20 @@ -1620,12 +1624,18 @@
    21  			isa = XCBuildConfiguration;
    21  			isa = XCBuildConfiguration;
    22  			buildSettings = {
    22  			buildSettings = {
    23  				ALWAYS_SEARCH_USER_PATHS = NO;
    23  				ALWAYS_SEARCH_USER_PATHS = NO;
    24 -				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
    24 -				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
    25 +				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
    25 +				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
    35  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
    35  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
    36 +				OTHER_CFLAGS = "";
    36 +				OTHER_CFLAGS = "";
    37  				PREBINDING = NO;
    37  				PREBINDING = NO;
    38  				SDKROOT = iphoneos;
    38  				SDKROOT = iphoneos;
    39  				TARGETED_DEVICE_FAMILY = "1,2";
    39  				TARGETED_DEVICE_FAMILY = "1,2";
    40 diff -r f2c2f0ecba5f Xcode-iPhoneOS/SDL/testsdl-Info.plist
    40 diff -r 1fbe1c202501 include/SDL_config_iphoneos.h
    41 --- a/Xcode-iPhoneOS/SDL/testsdl-Info.plist	Sun Jan 30 13:42:05 2011 -0800
    41 --- a/include/SDL_config_iphoneos.h	Mon Feb 07 10:40:21 2011 -0800
    42 +++ b/Xcode-iPhoneOS/SDL/testsdl-Info.plist	Mon Jan 31 23:57:58 2011 +0100
    42 +++ b/include/SDL_config_iphoneos.h	Mon Feb 07 23:10:55 2011 +0100
    43 @@ -16,7 +16,5 @@
       
    44  	<string>????</string>
       
    45  	<key>CFBundleVersion</key>
       
    46  	<string>1.0</string>
       
    47 -	<key>NSMainNibFile</key>
       
    48 -	<string>MainWindow</string>
       
    49  </dict>
       
    50  </plist>
       
    51 diff -r f2c2f0ecba5f include/SDL_config_iphoneos.h
       
    52 --- a/include/SDL_config_iphoneos.h	Sun Jan 30 13:42:05 2011 -0800
       
    53 +++ b/include/SDL_config_iphoneos.h	Mon Jan 31 23:57:58 2011 +0100
       
    54 @@ -119,7 +119,7 @@
    43 @@ -119,7 +119,7 @@
    55  /* enable iPhone version of Core Audio driver */
    44  /* enable iPhone version of Core Audio driver */
    56  #define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
    45  #define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
    57  /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
    46  /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
    58 -#define SDL_AUDIO_DRIVER_DUMMY	1
    47 -#define SDL_AUDIO_DRIVER_DUMMY	1
    59 +#define SDL_AUDIO_DRIVER_DUMMY	0
    48 +#define SDL_AUDIO_DRIVER_DUMMY	0
    60  
    49  
    61  /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
    50  /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
    62  #define SDL_HAPTIC_DISABLED	1
    51  #define SDL_HAPTIC_DISABLED	1
    63 @@ -140,14 +140,17 @@
    52 @@ -140,15 +140,18 @@
    64  
    53  
    65  /* Supported video drivers */
    54  /* Supported video drivers */
    66  #define SDL_VIDEO_DRIVER_UIKIT	1
    55  #define SDL_VIDEO_DRIVER_UIKIT	1
    67 -#define SDL_VIDEO_DRIVER_DUMMY	1
    56 -#define SDL_VIDEO_DRIVER_DUMMY	1
    68 +#define SDL_VIDEO_DRIVER_DUMMY	0
    57 +#define SDL_VIDEO_DRIVER_DUMMY	0
    69  
    58  
    70  /* enable OpenGL ES */
    59  /* enable OpenGL ES */
    71  #define SDL_VIDEO_OPENGL_ES	1
    60  #define SDL_VIDEO_OPENGL_ES	1
    72  #define SDL_VIDEO_RENDER_OGL_ES	1
    61  #define SDL_VIDEO_RENDER_OGL_ES	1
       
    62 -#define SDL_VIDEO_RENDER_OGL_ES2	1
       
    63 +#define SDL_VIDEO_RENDER_OGL_ES2	0
    73  
    64  
    74  /* Enable system power support */
    65  /* Enable system power support */
    75 -#define SDL_POWER_UIKIT 1
    66 -#define SDL_POWER_UIKIT 1
    76 +#define SDL_POWER_UIKIT 0
    67 +#define SDL_POWER_UIKIT 0
    77 +
    68 +
    78 +/* enable joystick subsystem */
    69 +/* enable joystick subsystem */
    79 +#define SDL_JOYSTICK_DISABLED 1
    70 +#define SDL_JOYSTICK_DISABLED 1
    80  
    71  
    81  /* enable iPhone keyboard support */
    72  /* enable iPhone keyboard support */
    82  #define SDL_IPHONE_KEYBOARD 1
    73  #define SDL_IPHONE_KEYBOARD 1
    83 @@ -157,4 +160,7 @@
    74 @@ -158,4 +161,7 @@
    84   */
    75   */
    85  #define SDL_IPHONE_MAX_GFORCE 5.0
    76  #define SDL_IPHONE_MAX_GFORCE 5.0
    86  
    77  
    87 +/* Tag to grab the uikit view from external code for further modification */
    78 +/* Tag to grab the uikit view from external code for further modification */
    88 +#define SDL_VIEW_TAG 456987
    79 +#define SDL_VIEW_TAG 456987
    89 +
    80 +
    90  #endif /* _SDL_config_iphoneos_h */
    81  #endif /* _SDL_config_iphoneos_h */
    91 diff -r f2c2f0ecba5f src/video/SDL_video.c
       
    92 --- a/src/video/SDL_video.c	Sun Jan 30 13:42:05 2011 -0800
       
    93 +++ b/src/video/SDL_video.c	Mon Jan 31 23:57:58 2011 +0100
       
    94 @@ -1414,9 +1414,9 @@
       
    95          SDL_MinimizeWindow(window);
       
    96      }
       
    97  
       
    98 -    if (display->gamma && _this->SetDisplayGammaRamp) {
       
    99 +    /*if (display->gamma && _this->SetDisplayGammaRamp) {
       
   100          _this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
       
   101 -    }
       
   102 +    }*/
       
   103      if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
       
   104          && _this->SetWindowGrab) {
       
   105          _this->SetWindowGrab(_this, window);
       
   106 diff -r f2c2f0ecba5f src/video/uikit/SDL_uikitopengles.m
       
   107 --- a/src/video/uikit/SDL_uikitopengles.m	Sun Jan 30 13:42:05 2011 -0800
       
   108 +++ b/src/video/uikit/SDL_uikitopengles.m	Mon Jan 31 23:57:58 2011 +0100
       
   109 @@ -115,6 +115,7 @@
       
   110  									aBits: _this->gl_config.alpha_size \
       
   111  									depthBits: _this->gl_config.depth_size];
       
   112  	
       
   113 +	view.tag = SDL_VIEW_TAG;
       
   114  	data->view = view;
       
   115  	
       
   116  	/* add the view to our window */
       
   117 diff -r f2c2f0ecba5f src/video/uikit/SDL_uikitopenglview.m
       
   118 --- a/src/video/uikit/SDL_uikitopenglview.m	Sun Jan 30 13:42:05 2011 -0800
       
   119 +++ b/src/video/uikit/SDL_uikitopenglview.m	Mon Jan 31 23:57:58 2011 +0100
       
   120 @@ -117,6 +117,8 @@
       
   121  			return NO;
       
   122  		}
       
   123  		/* end create buffers */
       
   124 +            if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
       
   125 +                self.contentScaleFactor = [UIScreen mainScreen].scale;
       
   126  	}
       
   127  	return self;
       
   128  }
       
   129 diff -r f2c2f0ecba5f src/video/uikit/SDL_uikitview.h
       
   130 --- a/src/video/uikit/SDL_uikitview.h	Sun Jan 30 13:42:05 2011 -0800
       
   131 +++ b/src/video/uikit/SDL_uikitview.h	Mon Jan 31 23:57:58 2011 +0100
       
   132 @@ -23,11 +23,11 @@
       
   133  #include "SDL_stdinc.h"
       
   134  #include "SDL_events.h"
       
   135  
       
   136 -#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
       
   137 -#define FIXED_MULTITOUCH
       
   138 +#undef IPHONE_TOUCH_EFFICIENT_DANGEROUS
       
   139 +#undef FIXED_MULTITOUCH
       
   140  
       
   141  #ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
       
   142 -#define MAX_SIMULTANEOUS_TOUCHES 5
       
   143 +#define MAX_SIMULTANEOUS_TOUCHES 0
       
   144  #endif
       
   145  
       
   146  /* *INDENT-OFF* */
       
   147 diff -r f2c2f0ecba5f src/video/uikit/SDL_uikitview.m
       
   148 --- a/src/video/uikit/SDL_uikitview.m	Sun Jan 30 13:42:05 2011 -0800
       
   149 +++ b/src/video/uikit/SDL_uikitview.m	Mon Jan 31 23:57:58 2011 +0100
       
   150 @@ -298,6 +298,7 @@
       
   151  
       
   152  /* Terminates the editing session */
       
   153  - (BOOL)textFieldShouldReturn:(UITextField*)_textField {
       
   154 +	SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
       
   155  	[self hideKeyboard];
       
   156  	return YES;
       
   157  }
       
   158 @@ -312,7 +313,7 @@
       
   159  int SDL_iPhoneKeyboardShow(SDL_Window * window) {
       
   160  	
       
   161  	SDL_WindowData *data;
       
   162 -	SDL_uikitview *view;
       
   163 +	SDL_uikitview *view = NULL;
       
   164  	
       
   165  	if (NULL == window) {
       
   166  		SDL_SetError("Window does not exist");
       
   167 @@ -320,7 +321,8 @@
       
   168  	}
       
   169  	
       
   170  	data = (SDL_WindowData *)window->driverdata;
       
   171 -	view = data->view;
       
   172 +	if (data != NULL)
       
   173 +            view = data->view;
       
   174  	
       
   175  	if (nil == view) {
       
   176  		SDL_SetError("Window has no view");
       
   177 @@ -335,7 +337,7 @@
       
   178  int SDL_iPhoneKeyboardHide(SDL_Window * window) {
       
   179  	
       
   180  	SDL_WindowData *data;
       
   181 -	SDL_uikitview *view;
       
   182 +	SDL_uikitview *view = NULL;
       
   183  	
       
   184  	if (NULL == window) {
       
   185  		SDL_SetError("Window does not exist");
       
   186 @@ -343,7 +345,8 @@
       
   187  	}	
       
   188  	
       
   189  	data = (SDL_WindowData *)window->driverdata;
       
   190 -	view = data->view;
       
   191 +	if (data != NULL)
       
   192 +            view = data->view;
       
   193  	
       
   194  	if (NULL == view) {
       
   195  		SDL_SetError("Window has no view");
       
   196 @@ -358,7 +361,7 @@
       
   197  SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) {
       
   198  	
       
   199  	SDL_WindowData *data;
       
   200 -	SDL_uikitview *view;
       
   201 +	SDL_uikitview *view = NULL;
       
   202  	
       
   203  	if (NULL == window) {
       
   204  		SDL_SetError("Window does not exist");
       
   205 @@ -366,7 +369,8 @@
       
   206  	}	
       
   207  	
       
   208  	data = (SDL_WindowData *)window->driverdata;
       
   209 -	view = data->view;
       
   210 +	if (data != NULL)
       
   211 +            view = data->view;
       
   212  	
       
   213  	if (NULL == view) {
       
   214  		SDL_SetError("Window has no view");
       
   215 @@ -380,7 +384,7 @@
       
   216  int SDL_iPhoneKeyboardToggle(SDL_Window * window) {
       
   217  	
       
   218  	SDL_WindowData *data;
       
   219 -	SDL_uikitview *view;
       
   220 +	SDL_uikitview *view = NULL;
       
   221  	
       
   222  	if (NULL == window) {
       
   223  		SDL_SetError("Window does not exist");
       
   224 @@ -388,7 +392,8 @@
       
   225  	}	
       
   226  	
       
   227  	data = (SDL_WindowData *)window->driverdata;
       
   228 -	view = data->view;
       
   229 +	if (data != NULL)
       
   230 +            view = data->view;
       
   231  	
       
   232  	if (NULL == view) {
       
   233  		SDL_SetError("Window has no view");
       
   234 diff -r f2c2f0ecba5f src/video/uikit/SDL_uikitwindow.m
       
   235 --- a/src/video/uikit/SDL_uikitwindow.m	Sun Jan 30 13:42:05 2011 -0800
       
   236 +++ b/src/video/uikit/SDL_uikitwindow.m	Mon Jan 31 23:57:58 2011 +0100
       
   237 @@ -145,7 +145,10 @@
       
   238      if (SDL_UIKit_supports_multiple_displays) {
       
   239          [uiwindow setScreen:uiscreen];
       
   240      }
       
   241 -
       
   242 +    
       
   243 +    if ([UIScreen respondsToSelector:@selector(screens)] && [[UIScreen screens] count] > 1)
       
   244 +        uiwindow.screen = [[UIScreen screens] objectAtIndex:1];
       
   245 +    
       
   246      if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) {
       
   247          [uiwindow release];
       
   248          return -1;
       
   249 diff -r f2c2f0ecba5f src/video/uikit/keyinfotable.h
       
   250 --- a/src/video/uikit/keyinfotable.h	Sun Jan 30 13:42:05 2011 -0800
       
   251 +++ b/src/video/uikit/keyinfotable.h	Mon Jan 31 23:57:58 2011 +0100
       
   252 @@ -54,7 +54,7 @@
       
   253  /*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   254  /*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   255  /*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   256 -/*  13 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   257 +/*  13 */ {   SDL_SCANCODE_RETURN, 0 },
       
   258  /*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   259  /*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   260  /*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
       
   261 @@ -137,7 +137,7 @@
       
   262  /*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
       
   263  /*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },			/* plus shift modifier '^' */
       
   264  /*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },		/* plus shift modifier '_' */
       
   265 -/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },		/* '`'
       
   266 +/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },		/* '`' */
       
   267  /*  97 */ {   SDL_SCANCODE_A, 0	},	
       
   268  /*  98 */ {   SDL_SCANCODE_B, 0 },
       
   269  /*  99 */ {   SDL_SCANCODE_C, 0 },