only output FPS on iOS when in debug mode

This commit is contained in:
Justin R. Miller
2014-02-06 17:06:02 -05:00
parent 29744cfa5a
commit 6d75c0209d

View File

@@ -22,6 +22,7 @@
@property (nonatomic) CGPoint center;
@property (nonatomic) CGFloat scale;
@property (nonatomic) CGFloat angle;
@property (nonatomic) BOOL debug;
@end
@@ -127,7 +128,9 @@ class MBXMapView
if (current - elapsed >= 1)
{
NSLog(@"FPS: %f", frames / (current - elapsed));
if (self.debug)
NSLog(@"FPS: %f", frames / (current - elapsed));
elapsed = current;
frames = 0;
}
@@ -227,7 +230,11 @@ class MBXMapView
- (void)handleThreeFingerLongPressGesture:(UILongPressGestureRecognizer *)threeFingerLongPress
{
if (threeFingerLongPress.state == UIGestureRecognizerStateBegan)
{
mapView->map.toggleDebug();
self.debug = ! self.debug;
}
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer