mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Turn retro_ctx into static local variable of core_ctl
This commit is contained in:
parent
0434c907c4
commit
cb78c1c610
@ -600,7 +600,7 @@ static bool event_init_core(void)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
core.poll_type = settings->input.poll_type_behavior;
|
core.poll_type = settings->input.poll_type_behavior;
|
||||||
core_ctl(CORE_CTL_INIT, &retro_ctx);
|
core_ctl(CORE_CTL_INIT, NULL);
|
||||||
rarch_ctl(RARCH_CTL_INIT_SYSTEM_AV_INFO, NULL);
|
rarch_ctl(RARCH_CTL_INIT_SYSTEM_AV_INFO, NULL);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include "netplay/netplay.h"
|
#include "netplay/netplay.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct retro_callbacks retro_ctx;
|
|
||||||
|
|
||||||
static bool input_polled;
|
static bool input_polled;
|
||||||
|
|
||||||
@ -74,9 +73,9 @@ static bool retro_set_default_callbacks(void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool retro_uninit_libretro_cbs(void)
|
static bool retro_uninit_libretro_cbs(void *data)
|
||||||
{
|
{
|
||||||
struct retro_callbacks *cbs = (struct retro_callbacks*)&retro_ctx;
|
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||||
|
|
||||||
if (!cbs)
|
if (!cbs)
|
||||||
return false;
|
return false;
|
||||||
@ -169,6 +168,8 @@ static void retro_set_rewind_callbacks(void)
|
|||||||
|
|
||||||
bool core_ctl(enum core_ctl_state state, void *data)
|
bool core_ctl(enum core_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
|
static struct retro_callbacks retro_ctx;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case CORE_CTL_RETRO_CTX_FRAME_CB:
|
case CORE_CTL_RETRO_CTX_FRAME_CB:
|
||||||
@ -224,9 +225,9 @@ bool core_ctl(enum core_ctl_state state, void *data)
|
|||||||
retro_set_rewind_callbacks();
|
retro_set_rewind_callbacks();
|
||||||
break;
|
break;
|
||||||
case CORE_CTL_INIT:
|
case CORE_CTL_INIT:
|
||||||
return retro_init_libretro_cbs(data);
|
return retro_init_libretro_cbs(&retro_ctx);
|
||||||
case CORE_CTL_DEINIT:
|
case CORE_CTL_DEINIT:
|
||||||
return retro_uninit_libretro_cbs();
|
return retro_uninit_libretro_cbs(&retro_ctx);
|
||||||
case CORE_CTL_NONE:
|
case CORE_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -84,8 +84,6 @@ typedef struct retro_callbacks
|
|||||||
retro_input_poll_t poll_cb;
|
retro_input_poll_t poll_cb;
|
||||||
} retro_callbacks_t;
|
} retro_callbacks_t;
|
||||||
|
|
||||||
extern retro_callbacks_t retro_ctx;
|
|
||||||
|
|
||||||
bool core_ctl(enum core_ctl_state state, void *data);
|
bool core_ctl(enum core_ctl_state state, void *data);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user