Browse Source

Fixed love.event.quit on un-fused iOS games to properly exit to the game list instead of just restarting the current game.

Alex Szpakowski 9 years ago
parent
commit
aab6dbda5f
1 changed files with 24 additions and 24 deletions
  1. 24 24
      src/love.cpp

+ 24 - 24
src/love.cpp

@@ -174,6 +174,21 @@ static int l_print_sdl_log(lua_State *L)
 
 
 static int runlove(int argc, char **argv)
 static int runlove(int argc, char **argv)
 {
 {
+#ifdef LOVE_LEGENDARY_APP_ARGV_HACK
+	int hack_argc = 0;
+	char **hack_argv = 0;
+	get_app_arguments(argc, argv, hack_argc, hack_argv);
+	argc = hack_argc;
+	argv = hack_argv;
+#endif // LOVE_LEGENDARY_APP_ARGV_HACK
+
+	// Oh, you just want the version? Okay!
+	if (argc > 1 && strcmp(argv[1], "--version") == 0)
+	{
+		printf("LOVE %s (%s)\n", love_version(), love_codename());
+		return 0;
+	}
+
 	// Create the virtual machine.
 	// Create the virtual machine.
 	lua_State *L = luaL_newstate();
 	lua_State *L = luaL_newstate();
 	luaL_openlibs(L);
 	luaL_openlibs(L);
@@ -238,6 +253,15 @@ static int runlove(int argc, char **argv)
 
 
 	lua_close(L);
 	lua_close(L);
 
 
+#if defined(LOVE_LEGENDARY_APP_ARGV_HACK) && !defined(LOVE_IOS)
+	if (hack_argv)
+	{
+		for (int i = 0; i<hack_argc; ++i)
+			delete [] hack_argv[i];
+		delete [] hack_argv;
+	}
+#endif // LOVE_LEGENDARY_APP_ARGV_HACK
+
 	return retval;
 	return retval;
 }
 }
 
 
@@ -245,14 +269,6 @@ int main(int argc, char **argv)
 {
 {
 	int retval = 0;
 	int retval = 0;
 
 
-#ifdef LOVE_LEGENDARY_APP_ARGV_HACK
-	int hack_argc = 0;
-	char **hack_argv = 0;
-	get_app_arguments(argc, argv, hack_argc, hack_argv);
-	argc = hack_argc;
-	argv = hack_argv;
-#endif // LOVE_LEGENDARY_APP_ARGV_HACK
-
 	if (strcmp(LOVE_VERSION_STRING, love_version()) != 0)
 	if (strcmp(LOVE_VERSION_STRING, love_version()) != 0)
 	{
 	{
 		printf("Version mismatch detected!\nLOVE binary is version %s\n"
 		printf("Version mismatch detected!\nLOVE binary is version %s\n"
@@ -260,13 +276,6 @@ int main(int argc, char **argv)
 		return 1;
 		return 1;
 	}
 	}
 
 
-	// Oh, you just want the version? Okay!
-	if (argc > 1 && strcmp(argv[1], "--version") == 0)
-	{
-		printf("LOVE %s (%s)\n", love_version(), love_codename());
-		return 0;
-	}
-
 #ifdef LOVE_IOS
 #ifdef LOVE_IOS
 	// on iOS we should never programmatically exit the app, so we'll just
 	// on iOS we should never programmatically exit the app, so we'll just
 	// "restart" when that is attempted. Games which use threads might cause
 	// "restart" when that is attempted. Games which use threads might cause
@@ -277,15 +286,6 @@ int main(int argc, char **argv)
 		retval = runlove(argc, argv);
 		retval = runlove(argc, argv);
 	}
 	}
 
 
-#if defined(LOVE_LEGENDARY_APP_ARGV_HACK) && !defined(LOVE_IOS)
-	if (hack_argv)
-	{
-		for (int i = 0; i<hack_argc; ++i)
-			delete [] hack_argv[i];
-		delete [] hack_argv;
-	}
-#endif // LOVE_LEGENDARY_APP_ARGV_HACK
-
 #ifdef LOVE_ANDROID
 #ifdef LOVE_ANDROID
 	SDL_Quit();
 	SDL_Quit();
 #endif
 #endif