From 99db8ca731431cc4e9e24e10fffd3153cd1a12b9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 15 Dec 2013 18:11:21 +0100 Subject: [PATCH] (iOS/OSX) Stub location functions --- apple/common/RAGameView.m | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 36cb2297f4..3941b3e4a8 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -20,6 +20,10 @@ #include "gfx/gfx_common.h" #include "gfx/gfx_context.h" +#include + +static CLLocationManager *locationManager; + // Define compatibility symbols and categories #ifdef IOS #include @@ -308,6 +312,34 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer } #endif +- (void)onLocationInit +{ + // Create the location manager if this object does not + // already have one. + if (nil == locationManager) + locationManager = [[CLLocationManager alloc] init]; + + locationManager.delegate = self; + locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; + + // Set a movement threshold for new events. + locationManager.distanceFilter = 500; // meters - TODO - make configurable +} + +- (void)onLocationStart +{ + [locationManager startUpdatingLocation]; +} + +- (void)onLocationStop +{ + [locationManager stopUpdatingLocation]; +} + +- (void)onLocationFree +{ +} + @end static RAScreen* get_chosen_screen()