Add lifetime status callbacks to location interface.

This commit is contained in:
Themaister 2013-12-20 08:44:15 +01:00
parent 3338513a9a
commit 188a233ec8
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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