update some sdl-1.3 bindings (working up to rev 5296)
authorkoda
Sun, 13 Mar 2011 18:23:51 +0100
changeset 5004 2efa6a414518
parent 5002 a9c44a8ffec8
child 5010 af4e205e4b5a
update some sdl-1.3 bindings (working up to rev 5296)
hedgewars/SDLh.pas
hedgewars/uMisc.pas
hedgewars/uStore.pas
hedgewars/uVariables.pas
project_files/HedgewarsMobile/SDL.patch
--- a/hedgewars/SDLh.pas	Sun Mar 13 03:43:18 2011 +0100
+++ b/hedgewars/SDLh.pas	Sun Mar 13 18:23:51 2011 +0100
@@ -93,10 +93,6 @@
 /////////////////////  CONSTANT DEFINITIONS /////////////////////
 /////////////////////////////////////////////////////////////////
 
-    SDL_SWSURFACE     = $00000000;
-    SDL_HWSURFACE     = $00000001;
-    SDL_SRCALPHA      = $00010000;
-
     SDL_INIT_TIMER    = $00000001;
     SDL_INIT_AUDIO    = $00000010;
     SDL_INIT_VIDEO    = $00000020;
@@ -114,76 +110,114 @@
     SDL_BUTTON_WHEELUP   = 4;
     SDL_BUTTON_WHEELDOWN = 5;
 
-
-{*begin SDL_Event binding*}
-
 {$IFDEF SDL13}
-    SDL_FIRSTEVENT = 0;
-    SDL_QUITEV = $100;
-    SDL_WINDOWEVENT = $200;
-    SDL_SYSWMEVENT = $201;
-    SDL_KEYDOWN = $300;
-    SDL_KEYUP = $301;
-    SDL_TEXTEDITING = $302;
-    SDL_TEXTINPUT = $303;
-    SDL_MOUSEMOTION  = $400;
+    // SDL_Event types
+    SDL_FIRSTEVENT      = 0;
+    SDL_QUITEV          = $100;
+    SDL_WINDOWEVENT     = $200;
+    SDL_SYSWMEVENT      = $201;
+    SDL_KEYDOWN         = $300;
+    SDL_KEYUP           = $301;
+    SDL_TEXTEDITING     = $302;
+    SDL_TEXTINPUT       = $303;
+    SDL_MOUSEMOTION     = $400;
     SDL_MOUSEBUTTONDOWN = $401;
-    SDL_MOUSEBUTTONUP = $402;
-    SDL_MOUSEWHEEL = $403;
-    SDL_PROXIMITYIN = $500;
-    SDL_PROXIMITYOUT = $501;
-    SDL_JOYAXISMOTION = $600;
-    SDL_JOYBALLMOTION = $601;
-    SDL_JOYHATMOTION = $602;
-    SDL_JOYBUTTONDOWN = $603;
-    SDL_JOYBUTTONUP = $604;
-    SDL_USEREVENT = $8000;
-    SDL_LASTEVENT = $FFFF;
-{$ELSE}
-    SDL_NOEVENT = 0;
-    SDL_ACTIVEEVENT = 1;
-    SDL_KEYDOWN = 2;
-    SDL_KEYUP = 3;
-    SDL_MOUSEMOTION  = 4;
-    SDL_MOUSEBUTTONDOWN = 5;
-    SDL_MOUSEBUTTONUP   = 6;
-    SDL_JOYAXISMOTION = 7;
-    SDL_JOYBALLMOTION = 8;
-    SDL_JOYHATMOTION = 9;
-    SDL_JOYBUTTONDOWN = 10;
-    SDL_JOYBUTTONUP = 11;
-    SDL_QUITEV = 12;
-    SDL_VIDEORESIZE = 16; // TODO: outdated? no longer in SDL 1.3?
-{$ENDIF}
-{*end SDL_Event binding*}
+    SDL_MOUSEBUTTONUP   = $402;
+    SDL_MOUSEWHEEL      = $403;
+    SDL_PROXIMITYIN     = $500;
+    SDL_PROXIMITYOUT    = $501;
+    SDL_JOYAXISMOTION   = $600;
+    SDL_JOYBALLMOTION   = $601;
+    SDL_JOYHATMOTION    = $602;
+    SDL_JOYBUTTONDOWN   = $603;
+    SDL_JOYBUTTONUP     = $604;
+    SDL_USEREVENT       = $8000;
+    SDL_LASTEVENT       = $FFFF;
 
-{$IFDEF SDL13}
-    SDL_ASYNCBLIT   = $08000000;
-    SDL_ANYFORMAT   = $10000000;
+    // SDL_Surface flags
+    SDL_SWSURFACE   = $00000000;  //*< Not used */
+    SDL_PREALLOC    = $00000001;  //*< Surface uses preallocated memory */
+    SDL_RLEACCEL    = $00000002;  //*< Surface is RLE encoded */
+    SDL_DONTFREE    = $00000004;  //*< Surface is referenced internally */
+    SDL_SRCALPHA    = $00010000;
+    SDL_SRCCOLORKEY = $00020000;
+    SDL_ANYFORMAT   = $00100000;
     SDL_HWPALETTE   = $00200000;
     SDL_DOUBLEBUF   = $00400000;
     SDL_FULLSCREEN  = $00800000;
-    SDL_HWACCEL     = $08000000;
-    SDL_SRCCOLORKEY = $00020000;
-    SDL_RLEACCEL    = $08000000;
+    SDL_RESIZABLE   = $01000000;
     SDL_NOFRAME     = $02000000;
     SDL_OPENGL      = $04000000;
-    SDL_RESIZABLE   = $01000000;
+    SDL_HWSURFACE   = $08000001;  //*< Not used */
+    SDL_ASYNCBLIT   = $08000000;  //*< Not used */
+    SDL_RLEACCELOK  = $08000000;  //*< Not used */
+    SDL_HWACCEL     = $08000000;  //*< Not used */
+
+    // SDL_WindowFlags (enum)
+    SDL_WINDOW_FULLSCREEN    = $00000001;      //*< fullscreen window, implies borderless */
+    SDL_WINDOW_OPENGL        = $00000002;      //*< window usable with OpenGL context */
+    SDL_WINDOW_SHOWN         = $00000004;      //*< window is visible */
+//  SDL_WINDOW_HIDDEN        = $00000008;      //*< window is not visible */
+    SDL_WINDOW_BORDERLESS    = $00000008;      //*< no window decoration */
+    SDL_WINDOW_RESIZABLE     = $00000010;      //*< window can be resized */
+    SDL_WINDOW_MINIMIZED     = $00000020;      //*< window is minimized */
+    SDL_WINDOW_MAXIMIZED     = $00000040;      //*< window is maximized */
+    SDL_WINDOW_INPUT_GRABBED = $00000100;      //*< window has grabbed input focus */
+    SDL_WINDOW_INPUT_FOCUS   = $00000200;      //*< window has input focus */
+    SDL_WINDOW_MOUSE_FOCUS   = $00000400;      //*< window has mouse focus */
+    SDL_WINDOW_FOREIGN       = $00000800;      //*< window not created by SDL */
+
+    SDL_WINDOWPOS_CENTERED_MASK = $2FFF0000;
+
+    // SDL_WindowEventID (enum)
+    SDL_WINDOWEVENT_NONE         = 0;    //*< Never used
+    SDL_WINDOWEVENT_SHOWN        = 1;    //*< Window has been shown
+    SDL_WINDOWEVENT_HIDDEN       = 2;    //*< Window has been hidden
+    SDL_WINDOWEVENT_EXPOSED      = 3;    //*< Window has been exposed and should be redrawn
+    SDL_WINDOWEVENT_MOVED        = 4;    //*< Window has been moved to data1, data2
+    SDL_WINDOWEVENT_RESIZED      = 5;    //*< Window size changed to data1xdata2
+    SDL_WINDOWEVENT_MINIMIZED    = 6;    //*< Window has been minimized
+    SDL_WINDOWEVENT_MAXIMIZED    = 7;    //*< Window has been maximized
+    SDL_WINDOWEVENT_RESTORED     = 8;    //*< Window has been restored to normal size and position
+    SDL_WINDOWEVENT_ENTER        = 9;    //*< Window has gained mouse focus
+    SDL_WINDOWEVENT_LEAVE        = 10;   //*< Window has lost mouse focus
+    SDL_WINDOWEVENT_FOCUS_GAINED = 11;   //*< Window has gained keyboard focus
+    SDL_WINDOWEVENT_FOCUS_LOST   = 12;   //*< Window has lost keyboard focus
+    SDL_WINDOWEVENT_CLOSE        = 13;   //*< The window manager requests that the window be closed */
 {$ELSE}
+    // SDL_Event types
+    SDL_NOEVENT         = 0;
+    SDL_ACTIVEEVENT     = 1;
+    SDL_KEYDOWN         = 2;
+    SDL_KEYUP           = 3;
+    SDL_MOUSEMOTION     = 4;
+    SDL_MOUSEBUTTONDOWN = 5;
+    SDL_MOUSEBUTTONUP   = 6;
+    SDL_JOYAXISMOTION   = 7;
+    SDL_JOYBALLMOTION   = 8;
+    SDL_JOYHATMOTION    = 9;
+    SDL_JOYBUTTONDOWN   = 10;
+    SDL_JOYBUTTONUP     = 11;
+    SDL_QUITEV          = 12;
+    SDL_VIDEORESIZE     = 16; // TODO: outdated? no longer in SDL 1.3?
+
+    // SDL_Surface flags
+    SDL_SWSURFACE   = $00000000;
+    SDL_HWSURFACE   = $00000001;
+    SDL_OPENGL      = $00000002;
     SDL_ASYNCBLIT   = $00000004;
+    SDL_RESIZABLE   = $00000010;
+    SDL_NOFRAME     = $00000020;
+    SDL_HWACCEL     = $00000100;
+    SDL_SRCCOLORKEY = $00001000;
+    SDL_RLEACCEL    = $00004000;
+    SDL_SRCALPHA    = $00010000;
     SDL_ANYFORMAT   = $00100000;
     SDL_HWPALETTE   = $20000000;
     SDL_DOUBLEBUF   = $40000000;
     SDL_FULLSCREEN  = $80000000;
-    SDL_HWACCEL     = $00000100;
-    SDL_SRCCOLORKEY = $00001000;
-    SDL_RLEACCEL    = $00004000;
-    SDL_NOFRAME     = $00000020;
-    SDL_OPENGL      = $00000002;
-    SDL_RESIZABLE   = $00000010;
 {$ENDIF}
 
-
 {$IFDEF ENDIAN_LITTLE}
     RMask = $000000FF;
     GMask = $0000FF00;
@@ -196,43 +230,12 @@
     AMask = $000000FF;
 {$ENDIF}
 
-{$IFDEF SDL13}
-    // SDL_WindowFlags (enum)
-    SDL_WINDOW_FULLSCREEN = $00000001;         //*< fullscreen window, implies borderless */
-    SDL_WINDOW_OPENGL = $00000002;             //*< window usable with OpenGL context */
-    SDL_WINDOW_SHOWN = $00000004;              //*< window is visible */
-    SDL_WINDOW_BORDERLESS = $00000008;         //*< no window decoration */
-    SDL_WINDOW_RESIZABLE = $00000010;          //*< window can be resized */
-    SDL_WINDOW_MINIMIZED = $00000020;          //*< window is minimized */
-    SDL_WINDOW_MAXIMIZED = $00000040;          //*< window is maximized */
-    SDL_WINDOW_INPUT_GRABBED = $00000100;      //*< window has grabbed input focus */
-    SDL_WINDOW_INPUT_FOCUS = $00000200;        //*< window has input focus */
-    SDL_WINDOW_MOUSE_FOCUS = $00000400;        //*< window has mouse focus */
-    SDL_WINDOW_FOREIGN = $00000800;            //*< window not created by SDL */
-
-    // SDL_WindowEventID (enum)
-    SDL_WINDOWEVENT_NONE = 0;            //*< Never used
-    SDL_WINDOWEVENT_SHOWN = 1;           //*< Window has been shown
-    SDL_WINDOWEVENT_HIDDEN = 2;          //*< Window has been hidden
-    SDL_WINDOWEVENT_EXPOSED = 3;         //*< Window has been exposed and should be redrawn
-    SDL_WINDOWEVENT_MOVED = 4;           //*< Window has been moved to data1, data2
-    SDL_WINDOWEVENT_RESIZED = 5;         //*< Window size changed to data1xdata2
-    SDL_WINDOWEVENT_MINIMIZED = 6;       //*< Window has been minimized
-    SDL_WINDOWEVENT_MAXIMIZED = 7;       //*< Window has been maximized
-    SDL_WINDOWEVENT_RESTORED = 8;        //*< Window has been restored to normal size and position
-    SDL_WINDOWEVENT_ENTER = 9;           //*< Window has gained mouse focus
-    SDL_WINDOWEVENT_LEAVE = 10;          //*< Window has lost mouse focus
-    SDL_WINDOWEVENT_FOCUS_GAINED = 11;   //*< Window has gained keyboard focus
-    SDL_WINDOWEVENT_FOCUS_LOST = 12;     //*< Window has lost keyboard focus
-    SDL_WINDOWEVENT_CLOSE = 13;          //*< The window manager requests that the window be closed */
-{$ENDIF}
-
     {* SDL_mixer *}
     MIX_MAX_VOLUME = 128;
-    MIX_INIT_FLAC = $00000001;
-    MIX_INIT_MOD  = $00000002;
-    MIX_INIT_MP3  = $00000004;
-    MIX_INIT_OGG  = $00000008;
+    MIX_INIT_FLAC  = $00000001;
+    MIX_INIT_MOD   = $00000002;
+    MIX_INIT_MP3   = $00000004;
+    MIX_INIT_OGG   = $00000008;
 
     {* SDL_TTF *}
     TTF_STYLE_NORMAL = 0;
@@ -247,8 +250,8 @@
     SDL_HAT_LEFT      = $08;
     SDL_HAT_RIGHTUP   = SDL_HAT_RIGHT or SDL_HAT_UP;
     SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT or SDL_HAT_DOWN;
-    SDL_HAT_LEFTUP    = SDL_HAT_LEFT or SDL_HAT_UP;
-    SDL_HAT_LEFTDOWN  = SDL_HAT_LEFT or SDL_HAT_DOWN;
+    SDL_HAT_LEFTUP    = SDL_HAT_LEFT  or SDL_HAT_UP;
+    SDL_HAT_LEFTDOWN  = SDL_HAT_LEFT  or SDL_HAT_DOWN;
 
     {* SDL_image *}
     IMG_INIT_JPG = $00000001;
@@ -277,6 +280,9 @@
 
     PSDL_PixelFormat = ^TSDL_PixelFormat;
     TSDL_PixelFormat = record
+{$IFDEF SDL13}
+        format: Longword;
+{$ENDIF}
         palette: Pointer;
         BitsPerPixel : Byte;
         BytesPerPixel: Byte;
@@ -292,8 +298,13 @@
         GMask : Longword;
         BMask : Longword;
         AMask : Longword;
+{$IFDEF SDL13}
+        refcount: LongInt;
+        next: Pointer;
+{$ELSE}
         colorkey: Longword;
-        alpha : Byte;
+        alpha: Byte;
+{$ENDIF}
         end;
 
 
@@ -720,7 +731,6 @@
 function  SDL_DestroyRenderer(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName;
 function  SDL_DestroyWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName;
 procedure SDL_VideoQuit; cdecl; external SDLLibName;
-function  SDL_SelectVideoDisplay(index: LongInt): LongInt; cdecl; external SDLLibName;
 function  SDL_GetNumVideoDisplays: LongInt; cdecl; external SDLLibName;
 
 function  SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r,g,b,a: byte): LongInt; cdecl; external SDLLibName;
@@ -733,6 +743,9 @@
 function  SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
 function  SDL_GetNumMice: LongInt; cdecl; external SDLLibName;
 function  SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName;
+
+function  SDL_AllocFormat(format: Longword): PSDL_PixelFormat; cdecl; external SDLLibName;
+procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); cdecl; external SDLLibName;
 {$ENDIF}
 
 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF};
@@ -863,7 +876,11 @@
 
 function SDL_MustLock(Surface: PSDL_Surface): Boolean;
 begin
+{$IFDEF SDL13}
+    SDL_MustLock:= ((surface^.flags and SDL_RLEACCEL) <> 0)
+{$ELSE}
     SDL_MustLock:= ( surface^.offset <> 0 ) or (( surface^.flags and (SDL_HWSURFACE or SDL_ASYNCBLIT or SDL_RLEACCEL)) <> 0)
+{$ENDIF}
 end;
 
 procedure SDLNet_Write16(value: Word; buf: pointer);
--- a/hedgewars/uMisc.pas	Sun Mar 13 03:43:18 2011 +0100
+++ b/hedgewars/uMisc.pas	Sun Mar 13 18:23:51 2011 +0100
@@ -21,7 +21,7 @@
 unit uMisc;
 interface
 
-uses    SDLh, uConsts, GLunit, uTypes;
+uses SDLh, uConsts, GLunit, uTypes;
 
 procedure movecursor(dx, dy: LongInt);
 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
@@ -116,11 +116,21 @@
 FreeMem(p)
 end;
 
+// http://www.idevgames.com/forums/thread-5602-post-21860.html#pid21860
 function doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
-{* for more information http://www.idevgames.com/forum/showpost.php?p=85864&postcount=7 *}
-var convertedSurf: PSDL_Surface = nil;
+const conversionFormat: TSDL_PixelFormat = (
+{$IFDEF SDL13}format: 0;{$ENDIF}
+        palette: nil; BitsPerPixel: 32; BytesPerPixel: 4;
+        Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0;
+{$IFDEF ENDIAN_LITTLE}Rshift: 0; Gshift: 8; Bshift: 16; Ashift: 24;
+{$ELSE} Rshift: 24; Gshift: 16; Bshift: 8; Ashift: 0;{$ENDIF}
+        RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask;
+{$IFDEF SDL13}refcount: 0; next: nil;
+{$ELSE} colorkey: 0; alpha: 255{$ENDIF});
+var convertedSurf: PSDL_Surface;
 begin
-    if (tmpsurf^.format^.bitsperpixel = 24) or ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) then
+    if ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) or
+       (tmpsurf^.format^.bitsperpixel = 24) then
         begin
         convertedSurf:= SDL_ConvertSurface(tmpsurf, @conversionFormat, SDL_SWSURFACE);
         SDL_FreeSurface(tmpsurf);
--- a/hedgewars/uStore.pas	Sun Mar 13 03:43:18 2011 +0100
+++ b/hedgewars/uStore.pas	Sun Mar 13 18:23:51 2011 +0100
@@ -881,6 +881,7 @@
 var flags: Longword = 0;
     ico: PSDL_Surface;
     buf: array[byte] of char;
+    x, y: LongInt;
 begin
     s:= s; // avoid compiler hint
     if Length(s) = 0 then cFullScreen:= not cFullScreen
@@ -922,20 +923,17 @@
     end;
 
 {$IFDEF SDL13}
-{$IFDEF IPHONEOS}
-    // ipad can have 2 monitors, display sdl window on the second one
-    SDL_SelectVideoDisplay(SDL_GetNumVideoDisplays() - 1);
-{$ENDIF}
-
     if SDLwindow = nil then
     begin
-        SDLwindow:= SDL_CreateWindow('Hedgewars', 0, 0, cScreenWidth, cScreenHeight,
-                        SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN
-                        {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS{$ENDIF});
+        // on ipad, when second monitor is attached, display window in second monitor always
+        x:= {$IFDEF IPHONEOS}(SDL_WINDOWPOS_CENTERED_MASK or (SDL_GetNumVideoDisplays() - 1)){$ELSE}0{$ENDIF};
+        y:= {$IFDEF IPHONEOS}(SDL_WINDOWPOS_CENTERED_MASK or (SDL_GetNumVideoDisplays() - 1)){$ELSE}0{$ENDIF};
+        SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN
+                        {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS {$ENDIF});
         SDLrender:= SDL_CreateRenderer(SDLwindow, -1, 1 and 2);
     end;
 
-    SDL_SetRenderDrawColor(SDLrender,0, 0, 0, 255);
+    SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255);
     SDL_RenderClear(SDLrender);
     SDL_RenderPresent(SDLrender);
 {$ELSE}
--- a/hedgewars/uVariables.pas	Sun Mar 13 03:43:18 2011 +0100
+++ b/hedgewars/uVariables.pas	Sun Mar 13 18:23:51 2011 +0100
@@ -2077,35 +2077,6 @@
             ejectY: 0)
         );
 
-
-    conversionFormat: TSDL_PixelFormat = (
-        palette: nil;
-        BitsPerPixel : 32;
-        BytesPerPixel: 4;
-        Rloss : 0;
-        Gloss : 0;
-        Bloss : 0;
-        Aloss : 0;
-{$IFDEF ENDIAN_LITTLE}
-        Rshift: 0;
-        Gshift: 8;
-        Bshift: 16;
-        Ashift: 24;
-{$ELSE}
-        Rshift: 24;
-        Gshift: 16;
-        Bshift: 8;
-        Ashift: 0;
-{$ENDIF}
-        RMask : RMask;
-        GMask : GMask;
-        BMask : BMask;
-        AMask : AMask;
-        colorkey: 0;
-        alpha : 255
-    );
-
-
 var
     Land: TCollisionArray;
     LandPixels: TLandArray;
--- a/project_files/HedgewarsMobile/SDL.patch	Sun Mar 13 03:43:18 2011 +0100
+++ b/project_files/HedgewarsMobile/SDL.patch	Sun Mar 13 18:23:51 2011 +0100
@@ -1,45 +1,25 @@
-diff -r 1fbe1c202501 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
---- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 10:40:21 2011 -0800
-+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Fri Feb 18 00:09:03 2011 +0100
-@@ -1603,11 +1603,15 @@
- 			isa = XCBuildConfiguration;
- 			buildSettings = {
- 				ALWAYS_SEARCH_USER_PATHS = NO;
-+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+diff -r 48067bfc300c Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
+--- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 14 11:50:18 2011 -0600
++++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Sun Mar 13 18:22:16 2011 +0100
+@@ -1695,6 +1695,7 @@
  				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  				GCC_C_LANGUAGE_STANDARD = c99;
  				GCC_DEBUGGING_SYMBOLS = full;
 +				GCC_THUMB_SUPPORT = NO;
-+				GCC_VERSION = com.apple.compilers.llvmgcc42;
  				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  				GCC_WARN_UNUSED_VARIABLE = NO;
-+				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\"";
  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
- 				ONLY_ACTIVE_ARCH = NO;
- 				PREBINDING = NO;
-@@ -1620,12 +1624,18 @@
- 			isa = XCBuildConfiguration;
- 			buildSettings = {
- 				ALWAYS_SEARCH_USER_PATHS = NO;
--				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
-+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+@@ -1712,6 +1713,7 @@
+ 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
  				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  				GCC_C_LANGUAGE_STANDARD = c99;
-+				GCC_OPTIMIZATION_LEVEL = s;
 +				GCC_THUMB_SUPPORT = NO;
-+				GCC_UNROLL_LOOPS = NO;
-+				GCC_VERSION = com.apple.compilers.llvmgcc42;
  				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  				GCC_WARN_UNUSED_VARIABLE = NO;
-+				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../include\"";
  				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
-+				OTHER_CFLAGS = "";
- 				PREBINDING = NO;
- 				SDKROOT = iphoneos;
- 				TARGETED_DEVICE_FAMILY = "1,2";
-diff -r 1fbe1c202501 include/SDL_config_iphoneos.h
---- a/include/SDL_config_iphoneos.h	Mon Feb 07 10:40:21 2011 -0800
-+++ b/include/SDL_config_iphoneos.h	Fri Feb 18 00:09:03 2011 +0100
+diff -r 48067bfc300c include/SDL_config_iphoneos.h
+--- a/include/SDL_config_iphoneos.h	Mon Feb 14 11:50:18 2011 -0600
++++ b/include/SDL_config_iphoneos.h	Sun Mar 13 18:22:16 2011 +0100
 @@ -119,7 +119,7 @@
  /* enable iPhone version of Core Audio driver */
  #define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
@@ -79,24 +59,28 @@
 +#define SDL_VIEW_TAG 456987
 +
  #endif /* _SDL_config_iphoneos_h */
-diff -r 1fbe1c202501 src/video/SDL_video.c
---- a/src/video/SDL_video.c	Mon Feb 07 10:40:21 2011 -0800
-+++ b/src/video/SDL_video.c	Fri Feb 18 00:09:03 2011 +0100
-@@ -1657,9 +1657,11 @@
-         SDL_MinimizeWindow(window);
-     }
+diff -r 48067bfc300c src/video/uikit/SDL_uikitappdelegate.m
+--- a/src/video/uikit/SDL_uikitappdelegate.m	Mon Feb 14 11:50:18 2011 -0600
++++ b/src/video/uikit/SDL_uikitappdelegate.m	Sun Mar 13 18:22:16 2011 +0100
+@@ -35,6 +35,7 @@
+ static int forward_argc;
+ static char **forward_argv;
+ 
++#if 0
+ int main(int argc, char **argv) {
  
-+    /*
-     if (display->gamma && _this->SetDisplayGammaRamp) {
-         _this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
-     }
-+    */
-     if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
-         && _this->SetWindowGrab) {
-         _this->SetWindowGrab(_this, window);
-diff -r 1fbe1c202501 src/video/uikit/SDL_uikitopengles.m
---- a/src/video/uikit/SDL_uikitopengles.m	Mon Feb 07 10:40:21 2011 -0800
-+++ b/src/video/uikit/SDL_uikitopengles.m	Fri Feb 18 00:09:03 2011 +0100
+     int i;
+@@ -55,6 +56,7 @@
+     [pool release];
+     
+ }
++#endif
+ 
+ @implementation SDLUIKitDelegate
+ 
+diff -r 48067bfc300c src/video/uikit/SDL_uikitopengles.m
+--- a/src/video/uikit/SDL_uikitopengles.m	Mon Feb 14 11:50:18 2011 -0600
++++ b/src/video/uikit/SDL_uikitopengles.m	Sun Mar 13 18:22:16 2011 +0100
 @@ -117,6 +117,7 @@
                                      majorVersion: _this->gl_config.major_version];