Cleanups to frontend_ctx

This commit is contained in:
twinaphex 2013-07-27 12:59:23 +02:00
parent 1e70a46dd8
commit 4eb283b7e3
4 changed files with 27 additions and 19 deletions

View File

@ -18,12 +18,6 @@
#include "../conf/config_file.h"
#include "../file.h"
#if defined(HAVE_RGUI)
#include "menu/rgui.h"
#elif defined(HAVE_RMENU)
#include "menu/rmenu.h"
#endif
#if defined(RARCH_CONSOLE)
#include "frontend_context.h"
frontend_ctx_driver_t *frontend_ctx;
@ -31,14 +25,6 @@ frontend_ctx_driver_t *frontend_ctx;
#if defined(__QNX__)
#include <bps/bps.h>
#elif defined(__CELLOS_LV2__)
#include "platform/platform_ps3.c"
#elif defined(GEKKO)
#include "platform/platform_gx.c"
#elif defined(_XBOX)
#include "platform/platform_xdk.c"
#elif defined(PSP)
#include "platform/platform_psp.c"
#elif defined(__APPLE__)
#include <dispatch/dispatch.h>
#include <pthread.h>
@ -114,7 +100,8 @@ static void system_preinit(void)
//Initialize BPS libraries
bps_initialize();
#elif defined(RARCH_CONSOLE)
frontend_ctx->init();
if (frontend_ctx->init)
frontend_ctx->init();
#endif
}
@ -303,7 +290,8 @@ int rarch_main(int argc, char *argv[])
menu_init();
#ifdef RARCH_CONSOLE
frontend_ctx->process_args(argc, argv);
if (frontend_ctx->process_args)
frontend_ctx->process_args(argc, argv);
g_extern.lifecycle_mode_state |= 1ULL << MODE_LOAD_GAME;
#else
g_extern.lifecycle_mode_state |= 1ULL << MODE_GAME;
@ -432,9 +420,10 @@ int rarch_main(int argc, char *argv[])
fclose(g_extern.log_file);
g_extern.log_file = NULL;
#endif
frontend_ctx->deinit();
if (frontend_ctx->deinit)
frontend_ctx->deinit();
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN))
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN) && frontend_ctx->exitspawn)
frontend_ctx->exitspawn();
#endif

View File

@ -24,6 +24,12 @@
#include "../config.h"
#endif
#if defined(HAVE_RGUI)
#include "menu/rgui.h"
#elif defined(HAVE_RMENU)
#include "menu/rmenu.h"
#endif
typedef struct frontend_ctx_driver
{
void (*get_environment_settings)(int argc, char *argv[]);

View File

@ -348,7 +348,6 @@ static void system_exec(const char *path, bool should_load_game)
XLaunchNewImage(path, NULL);
#endif
#endif
}
const frontend_ctx_driver_t frontend_ctx_xdk = {

View File

@ -440,10 +440,24 @@ REWIND
============================================================ */
#include "../rewind.c"
/*============================================================
FRONTEND
============================================================ */
#if defined(RARCH_CONSOLE)
#include "../frontend/frontend_context.c"
#endif
#if defined(__CELLOS_LV2__)
#include "../frontend/platform/platform_ps3.c"
#elif defined(GEKKO)
#include "../frontend/platform/platform_gx.c"
#elif defined(_XBOX)
#include "../frontend/platform/platform_xdk.c"
#elif defined(PSP)
#include "../frontend/platform/platform_psp.c"
#endif
/*============================================================
MAIN
============================================================ */