mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-13 22:08:34 +00:00
Add lifetime status callbacks to location interface.
This commit is contained in:
parent
3338513a9a
commit
188a233ec8
7
driver.c
7
driver.c
@ -783,6 +783,9 @@ void init_location(void)
|
||||
RARCH_ERR("Failed to initialize location driver. Will continue without location.\n");
|
||||
g_extern.location_active = false;
|
||||
}
|
||||
|
||||
if (g_extern.system.location_callback.initialized)
|
||||
g_extern.system.location_callback.initialized();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -871,7 +874,11 @@ void uninit_camera(void)
|
||||
void uninit_location(void)
|
||||
{
|
||||
if (driver.location_data && driver.location)
|
||||
{
|
||||
if (g_extern.system.location_callback.deinitialized)
|
||||
g_extern.system.location_callback.deinitialized();
|
||||
driver.location->free(driver.location_data);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -769,12 +769,19 @@ typedef void (*retro_location_stop_t)(void);
|
||||
typedef bool (*retro_location_get_position_t)(double *lat, double *lon, double *horiz_accuracy,
|
||||
double *vert_accuracy);
|
||||
|
||||
// Callback which signals when the camera driver is initialized and/or deinitialized.
|
||||
// retro_location_start_t can be called in initialized callback.
|
||||
typedef void (*retro_location_lifetime_status_t)(void);
|
||||
|
||||
struct retro_location_callback
|
||||
{
|
||||
retro_location_start_t start;
|
||||
retro_location_stop_t stop;
|
||||
retro_location_get_position_t get_position;
|
||||
retro_location_set_interval_t set_interval;
|
||||
|
||||
retro_location_lifetime_status_t initialized;
|
||||
retro_location_lifetime_status_t deinitialized;
|
||||
};
|
||||
|
||||
enum retro_rumble_effect
|
||||
|
Loading…
Reference in New Issue
Block a user