mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 08:52:41 +00:00
(Location) Environ GET_LOCATION_INTERFACE should be implemented now
This commit is contained in:
parent
581aab1e3e
commit
031a9d05be
22
driver.c
22
driver.c
@ -641,6 +641,28 @@ void driver_location_stop(void)
|
||||
if (driver.location && driver.location_data)
|
||||
driver.location->stop(driver.location_data);
|
||||
}
|
||||
|
||||
void driver_location_set_interval(int interval_msecs, int interval_distance)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
driver.location->set_interval(driver.location_data, interval_msecs, interval_distance);
|
||||
}
|
||||
|
||||
double driver_location_get_latitude(void)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
return driver.location->get_latitude(driver.location_data);
|
||||
else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double driver_location_get_longitude(void)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
return driver.location->get_longitude(driver.location_data);
|
||||
else
|
||||
return 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
uintptr_t driver_get_current_framebuffer(void)
|
||||
|
3
driver.h
3
driver.h
@ -604,6 +604,9 @@ void driver_camera_poll(void);
|
||||
#ifdef HAVE_LOCATION
|
||||
bool driver_location_start(void);
|
||||
void driver_location_stop(void);
|
||||
double driver_location_get_latitude(void);
|
||||
double driver_location_get_longitude(void);
|
||||
void driver_location_set_interval(int, int);
|
||||
#endif
|
||||
|
||||
extern driver_t driver;
|
||||
|
@ -840,6 +840,11 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
RARCH_LOG("Environ GET_LOCATION_INTERFACE.\n");
|
||||
struct retro_location_callback *cb = (struct retro_location_callback*)data;
|
||||
cb->start = driver_location_start;
|
||||
cb->stop = driver_location_stop;
|
||||
cb->get_latitude = driver_location_get_latitude;
|
||||
cb->get_longitude = driver_location_get_longitude;
|
||||
cb->set_interval = driver_location_set_interval;
|
||||
g_extern.system.location_callback = *cb;
|
||||
break;
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ typedef void (*retro_location_set_interval_t)(int interval_ms, int interval_dist
|
||||
|
||||
//Start location services. The device will start listening for changes to the
|
||||
//current location at regular intervals (which are defined with retro_location_set_interval_t).
|
||||
typedef void (*retro_location_start_t)(void);
|
||||
typedef bool (*retro_location_start_t)(void);
|
||||
|
||||
//Stop location services. The device will stop listening for changes to the current
|
||||
//location.
|
||||
|
Loading…
x
Reference in New Issue
Block a user