mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
5fbf2d7713
Add front camera support for Android Allow to change the active camera in-game
35 lines
879 B
Plaintext
35 lines
879 B
Plaintext
#import "LocationHelper.h"
|
|
|
|
@interface LocationHelper()
|
|
@end
|
|
|
|
@implementation LocationHelper
|
|
|
|
-(id) init {
|
|
NSLog(@"LocationHelper::init");
|
|
locationManager = [[CLLocationManager alloc] init];
|
|
[locationManager setDelegate:self];
|
|
return self;
|
|
}
|
|
|
|
-(void) startLocationUpdates {
|
|
NSLog(@"LocationHelper::startLocationUpdates");
|
|
if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
|
|
[locationManager requestWhenInUseAuthorization];
|
|
}
|
|
[locationManager startUpdatingLocation];
|
|
}
|
|
|
|
-(void) stopLocationUpdates {
|
|
NSLog(@"LocationHelper::stopLocationUpdates");
|
|
[locationManager stopUpdatingLocation];
|
|
}
|
|
|
|
- (void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
|
|
for (id location in locations) {
|
|
[self.delegate SetGpsDataIOS:location];
|
|
}
|
|
}
|
|
|
|
@end
|