mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(Android) Initialize some code directly in android_app_entry
This commit is contained in:
parent
1a591baaf3
commit
201b1d4ec7
@ -227,16 +227,23 @@ static void android_app_entry(void *data)
|
|||||||
{
|
{
|
||||||
char *argv[1];
|
char *argv[1];
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
struct android_app *android_app = (struct android_app*)data;
|
||||||
|
|
||||||
if (rarch_main(argc, argv, data) != 0)
|
memset(&g_android, 0, sizeof(g_android));
|
||||||
|
g_android = android_app;
|
||||||
|
|
||||||
|
slock_lock(android_app->mutex);
|
||||||
|
android_app->running = 1;
|
||||||
|
scond_broadcast(android_app->cond);
|
||||||
|
slock_unlock(android_app->mutex);
|
||||||
|
|
||||||
|
if (rarch_main(argc, argv, android_app) != 0)
|
||||||
goto end;
|
goto end;
|
||||||
#ifndef HAVE_MAIN
|
|
||||||
while (rarch_main_iterate() != -1);
|
while (rarch_main_iterate() != -1);
|
||||||
|
|
||||||
main_exit(data);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
main_exit(data);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,19 +261,19 @@ void ANativeActivity_onCreate(ANativeActivity* activity,
|
|||||||
(void)savedStateSize;
|
(void)savedStateSize;
|
||||||
|
|
||||||
RARCH_LOG("Creating Native Activity: %p\n", activity);
|
RARCH_LOG("Creating Native Activity: %p\n", activity);
|
||||||
activity->callbacks->onDestroy = onDestroy;
|
activity->callbacks->onDestroy = onDestroy;
|
||||||
activity->callbacks->onStart = onStart;
|
activity->callbacks->onStart = onStart;
|
||||||
activity->callbacks->onResume = onResume;
|
activity->callbacks->onResume = onResume;
|
||||||
activity->callbacks->onSaveInstanceState = NULL;
|
activity->callbacks->onSaveInstanceState = NULL;
|
||||||
activity->callbacks->onPause = onPause;
|
activity->callbacks->onPause = onPause;
|
||||||
activity->callbacks->onStop = onStop;
|
activity->callbacks->onStop = onStop;
|
||||||
activity->callbacks->onConfigurationChanged = onConfigurationChanged;
|
activity->callbacks->onConfigurationChanged = onConfigurationChanged;
|
||||||
activity->callbacks->onLowMemory = NULL;
|
activity->callbacks->onLowMemory = NULL;
|
||||||
activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
|
activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
|
||||||
activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
|
activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
|
||||||
activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
|
activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
|
||||||
activity->callbacks->onInputQueueCreated = onInputQueueCreated;
|
activity->callbacks->onInputQueueCreated = onInputQueueCreated;
|
||||||
activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
|
activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
|
||||||
|
|
||||||
/* These are set only for the native activity,
|
/* These are set only for the native activity,
|
||||||
* and are reset when it ends. */
|
* and are reset when it ends. */
|
||||||
@ -687,14 +694,6 @@ static void frontend_android_init(void *data)
|
|||||||
ALOOPER_EVENT_INPUT, NULL, NULL);
|
ALOOPER_EVENT_INPUT, NULL, NULL);
|
||||||
android_app->looper = looper;
|
android_app->looper = looper;
|
||||||
|
|
||||||
slock_lock(android_app->mutex);
|
|
||||||
android_app->running = 1;
|
|
||||||
scond_broadcast(android_app->cond);
|
|
||||||
slock_unlock(android_app->mutex);
|
|
||||||
|
|
||||||
memset(&g_android, 0, sizeof(g_android));
|
|
||||||
g_android = (struct android_app*)android_app;
|
|
||||||
|
|
||||||
RARCH_LOG("Waiting for Android Native Window to be initialized ...\n");
|
RARCH_LOG("Waiting for Android Native Window to be initialized ...\n");
|
||||||
|
|
||||||
while (!android_app->window)
|
while (!android_app->window)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user