mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(Location) Add g_extern.system handle to retro_location_callback
This commit is contained in:
parent
fd5a3fa9da
commit
dfe42f4026
4
driver.c
4
driver.c
@ -756,7 +756,7 @@ void init_location(void)
|
||||
|
||||
find_location_driver();
|
||||
|
||||
driver.location_data = location_init_func(g_settings.location.update_interval_ms, g_settings.location.update_interval_distance);
|
||||
driver.location_data = location_init_func(g_extern.system.location_callback.interval_in_ms, g_extern.system.location_callback.interval_distance_in_meters);
|
||||
|
||||
if (!driver.location_data)
|
||||
{
|
||||
@ -821,7 +821,7 @@ void init_drivers(void)
|
||||
#ifdef HAVE_LOCATION
|
||||
// FIXME
|
||||
// Only init location driver if we're ever going to use it.
|
||||
//if (g_extern.system.camera_callback.caps)
|
||||
if (g_extern.system.location_callback)
|
||||
init_location();
|
||||
#endif
|
||||
|
||||
|
@ -840,6 +840,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
RARCH_LOG("Environ GET_LOCATION_INTERFACE.\n");
|
||||
struct retro_location_interface *cb = (struct retro_location_interface*)data;
|
||||
g_extern.system.location_callback = *cb;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
@ -427,6 +427,9 @@ struct global
|
||||
struct retro_disk_control_callback disk_control;
|
||||
struct retro_hw_render_callback hw_render_callback;
|
||||
struct retro_camera_callback camera_callback;
|
||||
#ifdef HAVE_LOCATION
|
||||
struct retro_location_callback location_callback;
|
||||
#endif
|
||||
|
||||
struct retro_frame_time_callback frame_time;
|
||||
retro_usec_t frame_time_last;
|
||||
|
@ -41,7 +41,7 @@
|
||||
// bound to.
|
||||
// The libretro core used is set with SET_LIBRETRO_PATH, and path to game is passed in _EXEC. NULL means no game.
|
||||
#define RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE (RETRO_ENVIRONMENT_PRIVATE | 3)
|
||||
// struct retro_location_interface * --
|
||||
// struct retro_location_callback * --
|
||||
// Gets access to the location interface.
|
||||
// The purpose of this interface is to be able to retrieve location-based information from the host device,
|
||||
// such as current latitude / longitude.
|
||||
@ -68,7 +68,7 @@ typedef double (*retro_location_get_latitude_t)(void);
|
||||
//Get the longitude of the current location.
|
||||
typedef double (*retro_location_get_longitude_t)(void);
|
||||
|
||||
struct retro_location_interface
|
||||
struct retro_location_callback
|
||||
{
|
||||
int interval_in_ms;
|
||||
int interval_distance_in_meters;
|
||||
|
Loading…
x
Reference in New Issue
Block a user