Selaa lähdekoodia

Fixed exiting on Android.

Lasse Öörni 12 vuotta sitten
vanhempi
sitoutus
e74ee4ce52

+ 6 - 0
Source/Android/src/org/libsdl/app/SDLActivity.java

@@ -284,6 +284,12 @@ public class SDLActivity extends Activity {
         return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
     }
 
+    // Urho3D: added function
+    public static void finishActivity()
+    {
+        mSingleton.sendCommand(COMMAND_FINISH, null);
+    }
+
     public static boolean sendMessage(int command, int param) {
         return mSingleton.sendCommand(command, Integer.valueOf(param));
     }

+ 2 - 1
Source/ThirdParty/SDL/src/video/android/SDL_androidevents.c

@@ -26,7 +26,8 @@
 #if SDL_VIDEO_DRIVER_ANDROID
 
 /* We're going to do this by default */
-#define SDL_ANDROID_BLOCK_ON_PAUSE  1
+// Urho3D: do not block on pause to allow exiting the application
+//#define SDL_ANDROID_BLOCK_ON_PAUSE  1
 
 #include "SDL_androidevents.h"
 #include "SDL_events.h"