mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-24 05:31:15 +00:00
(UI companion) Some further improvements
This commit is contained in:
parent
4c2b301efb
commit
f8a31effb0
3
driver.h
3
driver.h
@ -212,9 +212,8 @@ typedef struct driver
|
||||
void *location_data;
|
||||
void *resampler_data;
|
||||
void *recording_data;
|
||||
#ifdef HAVE_NETPLAY
|
||||
void *netplay_data;
|
||||
#endif
|
||||
void *ui_companion_data;
|
||||
|
||||
bool audio_active;
|
||||
bool video_active;
|
||||
|
@ -91,6 +91,7 @@ void main_exit(args_type() args)
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||
|
||||
global->system.shutdown = false;
|
||||
|
||||
@ -123,6 +124,12 @@ void main_exit(args_type() args)
|
||||
|
||||
rarch_main_free();
|
||||
|
||||
if (ui)
|
||||
{
|
||||
if (ui->deinit)
|
||||
ui->deinit(driver->ui_companion_data);
|
||||
}
|
||||
|
||||
if (frontend)
|
||||
{
|
||||
if (frontend->shutdown)
|
||||
@ -333,6 +340,9 @@ returntype main_entry(signature())
|
||||
&global->system.info);
|
||||
}
|
||||
|
||||
if (driver)
|
||||
driver->ui_companion = (ui_companion_driver_t*)ui_companion_init_first();
|
||||
|
||||
#if defined(HAVE_MAIN_LOOP)
|
||||
while (rarch_main_iterate() != -1);
|
||||
|
||||
|
@ -16,19 +16,33 @@
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include "../ui_companion_driver.h"
|
||||
|
||||
typedef struct ui_companion_null
|
||||
{
|
||||
void *empty;
|
||||
} ui_companion_null_t;
|
||||
|
||||
static void ui_companion_null_deinit(void *data)
|
||||
{
|
||||
(void)data;
|
||||
ui_companion_null_t *handle = (ui_companion_null_t*)data;
|
||||
|
||||
if (handle)
|
||||
free(handle);
|
||||
}
|
||||
|
||||
static void ui_companion_null_init(void *data)
|
||||
static void *ui_companion_null_init(void)
|
||||
{
|
||||
(void)data;
|
||||
ui_companion_null_t *handle = (ui_companion_null_t*)calloc(1, sizeof(*handle));
|
||||
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_null = {
|
||||
|
@ -57,15 +57,11 @@ const ui_companion_driver_t *ui_companion_find_driver(const char *ident)
|
||||
const ui_companion_driver_t *ui_companion_init_first(void)
|
||||
{
|
||||
unsigned i;
|
||||
const ui_companion_driver_t *ui_companion = NULL;
|
||||
|
||||
for (i = 0; ui_companion_drivers[i]; i++)
|
||||
{
|
||||
ui_companion = ui_companion_drivers[i];
|
||||
break;
|
||||
}
|
||||
return ui_companion_drivers[i];
|
||||
|
||||
return ui_companion;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t *ui_companion_get_ptr(void)
|
||||
|
@ -30,7 +30,7 @@ extern "C" {
|
||||
|
||||
typedef struct ui_companion_driver
|
||||
{
|
||||
void (*init)(void *data);
|
||||
void *(*init)(void);
|
||||
void (*deinit)(void *data);
|
||||
void (*toggle_companion_ui)(void);
|
||||
void (*notify_content_loaded)(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user