From 03f8528315fa46c95991a34f3325d7b33ae5538c Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Sat, 02 May 2020 21:48:36 +0000
Subject: [PATCH] Update source to SDL2 2.0.12

---
 source/src/video/uikit/SDL_uikitappdelegate.m |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/source/src/video/uikit/SDL_uikitappdelegate.m b/source/src/video/uikit/SDL_uikitappdelegate.m
index 15762d2..ac37ebd 100644
--- a/source/src/video/uikit/SDL_uikitappdelegate.m
+++ b/source/src/video/uikit/SDL_uikitappdelegate.m
@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,15 +38,25 @@
 #undef main
 #endif
 
+static SDL_main_func forward_main;
 static int forward_argc;
 static char **forward_argv;
 static int exit_status;
 
-int main(int argc, char **argv)
+#if defined(SDL_MAIN_NEEDED) && !defined(IOS_DYLIB)
+/* SDL is being built as a static library, include main() */
+int main(int argc, char *argv[])
+{
+	return SDL_UIKitRunApp(argc, argv, SDL_main);
+}
+#endif /* SDL_MAIN_NEEDED && !IOS_DYLIB */
+
+int SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction)
 {
     int i;
 
     /* store arguments */
+	forward_main = mainFunction;
     forward_argc = argc;
     forward_argv = (char **)malloc((argc+1) * sizeof(char *));
     for (i = 0; i < argc; i++) {
@@ -333,6 +343,7 @@
         window.alpha = 0.0;
     } completion:^(BOOL finished) {
         window.hidden = YES;
+        UIKit_ForceUpdateHomeIndicator(); /* Wait for launch screen to hide so settings are applied to the actual view controller. */
     }];
 }
 
@@ -344,7 +355,7 @@
 
     /* run the user's application, passing argc and argv */
     SDL_iPhoneSetEventPump(SDL_TRUE);
-    exit_status = SDL_main(forward_argc, forward_argv);
+    exit_status = forward_main(forward_argc, forward_argv);
     SDL_iPhoneSetEventPump(SDL_FALSE);
 
     if (launchWindow) {

--
Gitblit v1.9.3