mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Replace more driver->frontend instances
This commit is contained in:
parent
5ed7c3abed
commit
f16fc89b1b
@ -267,15 +267,7 @@ int rarch_main(int argc, char *argv[], void *data)
|
|||||||
|
|
||||||
driver = driver_get_ptr();
|
driver = driver_get_ptr();
|
||||||
|
|
||||||
if (driver)
|
frontend_driver_init_first(args);
|
||||||
driver->frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
|
|
||||||
|
|
||||||
if (!driver || !driver->frontend_ctx)
|
|
||||||
RARCH_WARN("Frontend context could not be initialized.\n");
|
|
||||||
|
|
||||||
if (driver->frontend_ctx && driver->frontend_ctx->init)
|
|
||||||
driver->frontend_ctx->init(args);
|
|
||||||
|
|
||||||
rarch_main_new();
|
rarch_main_new();
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
@ -283,10 +275,10 @@ int rarch_main(int argc, char *argv[], void *data)
|
|||||||
global->async_jobs = async_job_new();
|
global->async_jobs = async_job_new();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (driver->frontend_ctx)
|
if (frontend_driver_is_inited())
|
||||||
{
|
{
|
||||||
if (!(ret = (main_load_content(argc, argv, args,
|
if (!(ret = (main_load_content(argc, argv, args,
|
||||||
driver->frontend_ctx->environment_get))))
|
frontend_driver_environment_get_ptr()))))
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "frontend_driver.h"
|
#include "frontend_driver.h"
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
|
#include "../verbosity.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -146,4 +147,33 @@ void frontend_driver_process_args(int *argc, char *argv[])
|
|||||||
return;
|
return;
|
||||||
frontend->process_args(argc, argv);
|
frontend->process_args(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool frontend_driver_is_inited(void)
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
if (!driver->frontend_ctx)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void frontend_driver_init_first(void *args)
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
if (driver)
|
||||||
|
driver->frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
|
||||||
|
|
||||||
|
if (!driver || !driver->frontend_ctx)
|
||||||
|
RARCH_WARN("Frontend context could not be initialized.\n");
|
||||||
|
|
||||||
|
if (driver->frontend_ctx && driver->frontend_ctx->init)
|
||||||
|
driver->frontend_ctx->init(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
environment_get_t frontend_driver_environment_get_ptr(void)
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
if (!driver || !driver->frontend_ctx)
|
||||||
|
return NULL;
|
||||||
|
return driver->frontend_ctx->environment_get;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -118,6 +118,12 @@ void frontend_driver_set_fork(bool a, bool b);
|
|||||||
|
|
||||||
void frontend_driver_process_args(int *argc, char *argv[]);
|
void frontend_driver_process_args(int *argc, char *argv[]);
|
||||||
|
|
||||||
|
bool frontend_driver_is_inited(void);
|
||||||
|
|
||||||
|
void frontend_driver_init_first(void *args);
|
||||||
|
|
||||||
|
environment_get_t frontend_driver_environment_get_ptr(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user